Http
Documentation of http-related Synapse Z environment functions
httpget
string httpget(url: string)
performs a HTTP GET request and returns the response body
httppost
string httppost(url: string, body: string)
performs a HTTP POST request and returns the response body
request
table request(request: table)
performs a HTTP request with the specified request prototype:
Field | Type | Description |
---|---|---|
Url | string | url to perform the HTTP request on |
Method | string | HTTP method of the request |
Body | string | body of the HTTP request |
Headers | table<string:string> | headers of the HTTP request |
Cookies | table<string:string> | cookies of the HTTP request |
and returns a response of this prototype:
Field | Type | Description |
---|---|---|
StatusCode | number | response status code |
Success | bool | whenever the request was successfull |
Body | string | response body |
Headers | table<string:string> | response headers |
Cookies | table | returns a blank table for backward compability |
with: additional synapse z headers:
Field | Type | Description |
---|---|---|
Syn-Fingerprint | string | a fingerprint of user machine |
Syn-User-Identifier | string | a fingerprint of user synapse account |