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:

FieldTypeDescription
Urlstringurl to perform the HTTP request on
MethodstringHTTP method of the request
Bodystringbody of the HTTP request
Headerstable<string:string>headers of the HTTP request
Cookiestable<string:string>cookies of the HTTP request

and returns a response of this prototype:

FieldTypeDescription
StatusCodenumberresponse status code
Successboolwhenever the request was successfull
Bodystringresponse body
Headerstable<string:string>response headers
Cookiestablereturns a blank table for backward compability

with: additional synapse z headers:

FieldTypeDescription
Syn-Fingerprintstringa fingerprint of user machine
Syn-User-Identifierstringa fingerprint of user synapse account