HTTPClient Object
Last updated 24/10/2023
The HTTPClient
object on the five
object provides many ways to interact with existing web content using the http protocol or the builtin headless web browser.
Five provides two modes to interact with an external API.
- RAW - This is straight text or JSON from the server.
- INTERACTIVE - This is a full headless web browser session.
Functions
The following functions can used on the httpClient
object on the five
object.
addData()
The addData()
is a function that adds a key value pair to the body of the post
request, or as URL encoded URL parameters for a get
request when using RAW mode for the get
and post
methods and returns null
on success.
addData(key: string, value: string) : FiveError;
get()
The get()
is a function that will issue a get
request to the server.
get([mode: string,] url: string) : HTTPResponse | BrowserPage;
addHeader()
The addHeader() is a function
addHeader() : string;
post()
The post() is a function
post() : string;
setBasicAuthentication ()
The setBasicAuthentication() is a function
setBasicAuthentication() : string;
setContent()
The setContent() is a function
setContent() : string;
setContentType()
The setContentType() is a function
setContentType() : string;
setOutputFilename()
The setOutputFilename() is a function
setOutputFilename() : string;