Libraries
Http request Source Code
 previous   up   next 

Types
httpRequest
Describes an HTTP request to be sent to a server.
httpResponse
Describes a response from a server (after sending an httpRequest).

httpRequest

const type: httpRequest

Describes an HTTP request to be sent to a server.


httpResponse

const type: httpResponse

Describes a response from a server (after sending an httpRequest).


Function Summary
void
setProxy (in string: serverName, in integer: portNumber)
Set the proxy server to be used for getHttp.
httpResponse
http (GET, in string: location)
Get the response from the location using the HTTP protocol.
httpResponse
http (GET, in string: location, in httpCreds: creds)
Get the response from the location using HTTP and some authentication.
httpResponse
http (DELETE, in string: location, in httpCreds: creds)
Send a DELETE request.
httpResponse
http (POST, in string: location, in httpBody: body, in httpCreds: creds)
Send a custom POST request (i.e. one with a preformatted body).
httpResponse
http (POST, in string: location, in string: body, in httpCreds: creds)
end a text/plain POST request.
httpResponse
http (POST, in string: location, in hash [string] string: fields, in httpCreds: creds)
Send an application/x-www-form-urlencoded POST request.

Function Detail

setProxy

const proc: setProxy (in string: serverName, in integer: portNumber)

Set the proxy server to be used for getHttp.


http

const func httpResponse: http (GET, in string: location)

Get the response from the location using the HTTP protocol.

http(GET, "example.com")
http(GET, "www.example.com/index.html")
Parameters:
location - Url without http:// at the beginning.
Returns:
the HTTP response from the location.

http

const func httpResponse: http (GET, in string: location, in httpCreds: creds)

Get the response from the location using HTTP and some authentication.

http(GET, "example.com", basicAuth("lelouch", "lamperouge"))
http(GET, "www.example.com/index.html", bearerAuth("ahardwontoken"))
Parameters:
location - Url without http:// at the beginning.
creds - Authorization data for the request (such as username and password).
Returns:
the HTTP response from the location.

http

const func httpResponse: http (DELETE, in string: location, in httpCreds: creds)

Send a DELETE request.


http

const func httpResponse: http (POST, in string: location, in httpBody: body, in httpCreds: creds)

Send a custom POST request (i.e. one with a preformatted body).


http

const func httpResponse: http (POST, in string: location, in string: body, in httpCreds: creds)

end a text/plain POST request.


http

const func httpResponse: http (POST, in string: location, in hash [string] string: fields, in httpCreds: creds)

Send an application/x-www-form-urlencoded POST request.



 previous   up   next