HTTPClient Class
Name: HTTPClient
Description:
- * HTTPClient class provides HTTP request functionality and ability to retrieve response
Package: org.active-link.net
Author: Zurab Davitiani
Version: 0.4.0
Extends: Socket
Requires: Socket
See: Socket
All Methods
HTTPClient
addRequestHeaderRaw
getRequestHeaders
setRequestBody
setRequestMethod
setRequestURI
setRequestUserAgent
setRequestVersion
sendRequest
HTTPClient
( string host, optional int port )
Description:
- * HTTP client class constructor accepts host (required) and port (optional, default 80) arguments
Arguments:
- string host
- optional int port
addRequestHeaderRaw
( string header )
Description:
- * Adds a supplied raw header to the internal header array
Returns: none
Arguments:
getRequestHeaders
( )
Description:
- * Gets a string containing all HTTP request headers in their raw form
Returns: string request HTTP headers
setRequestBody
( string body )
Description:
- * Sets HTTP request body/payload, used only when request method is POST
Returns: none
Arguments:
setRequestMethod
( string method )
Description:
- * Sets HTTP request method, GET or POST
Returns: none
Arguments:
setRequestURI
( string uri )
Description:
- * Sets request URI, if not set here, default will be /
Returns: none
Arguments:
setRequestUserAgent
( string userAgent )
Description:
- * Sets HTTP request User-Agent to send to the server, default is "ActiveLink NET Object/version"
Returns: none
Arguments:
setRequestVersion
( string version )
Description:
- * Sets HTTP protocol version to be used, default is "HTTP/1.0"
Returns: none
Arguments:
sendRequest
( )
Description:
- * After all settings are complete, send the request to the server
Returns: string server response if successful, false otherwise