Skip to end of metadata
Go to start of metadata


Return Types
Cookie DeleteRequest GetRequest HTTP_STATUS HeadRequest HttpClient OptionsRequest PostRequest PutRequest Response TraceRequest

Method Summary
HttpClient #createNewHttpClient()
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
byte[] #getMediaData(url, [http_clientname])
Get media (binary data) such as images in a variable.
String #getPageData(url)
Get all page html in a variable.

Method Details
createNewHttpClient

HttpClient createNewHttpClient ()

Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
Returns
HttpClient
Sample
var client = plugins.http.createNewHttpClient();
getMediaData

byte[] getMediaData (url, [http_clientname])

Get media (binary data) such as images in a variable. It also supports gzip-ed content.
Parameters
url
[http_clientname]
Returns
byte[]
Sample
var image_byte_array = plugins.http.getMediaData('http://www.cnn.com/cnn.gif');
getPageData

String getPageData (url)

Get all page html in a variable.
Parameters
url
Returns
String
Sample
// get data using a default connection
var pageData = plugins.http.getPageData('http://www.cnn.com');
  • No labels

1 Comment

  1. Anonymous

    no info about the setting: setTimeout //Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).
    plugins.http.setTimeout(1000,'client_name')
    //Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).

    plugins.http.setTimeout(1000,'client_name')