Touch Develop retirement postponed until June 22, 2019. Sign-in and access to cloud assets to be removed on May 23, 2018.Learn More..

Web Request

An HTTP web request
function (Web Request) → equals(other : Web Request) returns Boolean
Indicates if both requests are the same instance.
function (Web Request) → header(name : String) returns String
Gets the value of a given header
function (Web Request) → header names returns Collection of String
Gets the names of the headers
function (Web Request) → is invalid returns Boolean
Returns true if the current instance is useless
function (Web Request) → method returns String
Gets whether it was a 'get' or a 'post'.
function (Web Request) → post to wall
Displays the request to the wall
function (Web Request) → send returns Web Response
Performs the request synchronously
function (Web Request) → set accept(type : String)
Sets the Accept header type ('text/xml' for xml, 'application/json' for json).
function (Web Request) → set content(content : String)
Sets the content of a 'post' request
function (Web Request) → set content as buffer(bytes : Buffer)
Sets the content of a 'post' request as a binary buffer
function (Web Request) → set content as form(form : Form Builder)
Sets the content as multipart/form-data.
function (Web Request) → set content as json(json : Json Object)
Sets the content of a 'post' request as the JSON tree
function (Web Request) → set content as picture(pic : Picture, quality : Number)
Sets the content of a 'post' request as a JPEG encoded image. Quality from 0 (worse) to 1 (best).
function (Web Request) → set content as xml(xml : Xml Object)
Sets the content of a 'post' request as the XML tree
function (Web Request) → set credentials(name : String, password : String)
Sets the name and password for basic authentication. Requires an HTTPS URL, empty string clears.
function (Web Request) → set header(name : String, value : String)
Sets an HTML header value. Empty string clears the value
function (Web Request) → set method(method : String)
Sets the method. Default value is 'get'.
function (Web Request) → set url(url : String)
Sets the url of the request. Must be a valid internet address.
function (Web Request) → show notifications(visible : Boolean)
Indicates if program notifications should be shown to the user. Default is true.
function (Web Request) → url returns String
Gets the url of the request

edit this topic riltuzpbcp