Moai SDK
1.5 revision 1 (MoaiEdition)
|
Returns the progress of the download.
function getProgress ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Returns the response code returned by the server after a httpPost or httpGet call.
function getResponseCode ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Returns the response header given its name, or nil if it wasn't provided by the server. Header names are case-insensitive and if multiple responses are given, they will be concatenated with a comma separating the values.
function getResponseHeader ( MOAIHttpTaskBase self, string header )
self | ( MOAIHttpTaskBase ) |
header | ( string ) The name of the header to return (case-insensitive). |
Returns the size of the string obtained from a httpPost or httpGet call.
function getSize ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Returns the text obtained from a httpPost or httpGet call.
function getString ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Sends an API call to the server for downloading data. The callback function (from setCallback) will run when the call is complete, i.e. this action is asynchronous and returns almost instantly.
function httpGet ( MOAIHttpTaskBase self, string url [, string useragent, boolean verbose, boolean blocking ] )
self | ( MOAIHttpTaskBase ) |
url | ( string ) The URL on which to perform the GET request. |
useragent | ( string ) Optional. Default value is "Moai SDK beta; support |
verbose | ( boolean ) Optional. |
blocking | ( boolean ) Optional. Synchronous operation; block execution until complete. Default value is false. |
Sends an API call to the server for downloading data. The callback function (from setCallback) will run when the call is complete, i.e. this action is asynchronous and returns almost instantly.
function httpPost ( MOAIHttpTaskBase self, string url [, string data, string useragent, boolean verbose, boolean blocking ] )
self | ( MOAIHttpTaskBase ) |
url | ( string ) The URL on which to perform the GET request. |
data | ( string ) Optional. The string containing text to send as POST data. |
useragent | ( string ) Optional. Default value is "Moai SDK beta; support |
verbose | ( boolean ) Optional. |
blocking | ( boolean ) Optional. Synchronous operation; block execution until complete. Default value is false. |
function httpPost ( MOAIHttpTaskBase self, string url [, MOAIDataBuffer data, string useragent, boolean verbose, boolean blocking ] )
self | ( MOAIHttpTaskBase ) |
url | ( string ) The URL on which to perform the GET request. |
data | ( MOAIDataBuffer ) Optional. A MOAIDataBuffer object to send as POST data. |
useragent | ( string ) Optional. |
verbose | ( boolean ) Optional. |
blocking | ( boolean ) Optional. Synchronous operation; block execution until complete. Default value is false. |
Returns whether or not the task is busy.
function isBusy ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Parses the text data returned from a httpGet or httpPost operation as XML and then returns a MOAIXmlParser with the XML content initialized.
function parseXml ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Perform the HTTP task asynchronously.
function performAsync ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Perform the HTTP task synchronously ( blocking).
function performSync ( MOAIHttpTaskBase self )
self | ( MOAIHttpTaskBase ) |
Sets the body for a POST or PUT.
function setBody ( MOAIHttpTaskBase self [, string data ] )
self | ( MOAIHttpTaskBase ) |
data | ( string ) Optional. The string containing text to send as POST data. |
function setBody ( MOAIHttpTaskBase self [, MOAIDataBuffer data ] )
self | ( MOAIHttpTaskBase ) |
data | ( MOAIDataBuffer ) Optional. A MOAIDataBuffer object to send as POST data. |
Sets the callback function used when a request is complete.
function setCallback ( MOAIHttpTaskBase self, function callback )
self | ( MOAIHttpTaskBase ) |
callback | ( function ) The function to execute when the HTTP request is complete. The MOAIHttpTaskBase is passed as the first argument. |
Sets the file to save the cookies for this HTTP request.
function setCookieDst ( MOAIHttpTaskBase self, string filename )
self | ( MOAIHttpTaskBase ) |
filename | ( string ) name and path of the file to save the cookies to |
Sets the file to read the cookies for this HTTP request.
function setCookieSrc ( MOAIHttpTaskBase self, string filename )
self | ( MOAIHttpTaskBase ) |
filename | ( string ) name and path of the file to read the cookies from |
Sets whether or not curl calls will fail if the HTTP status code is above 400.
function setFailOnError ( MOAIHttpTaskBase self, boolean enable )
self | ( MOAIHttpTaskBase ) |
enable | ( boolean ) |
Sets whether or not curl should follow HTTP header redirects.
function setFollowRedirects ( MOAIHttpTaskBase self, boolean follow )
self | ( MOAIHttpTaskBase ) |
follow | ( boolean ) |
Sets a custom header field. May be used to override default headers.
function setHeader ( MOAIHttpTaskBase self, string key [, string value ] )
self | ( MOAIHttpTaskBase ) |
key | ( string ) |
value | ( string ) Optional. Default is "". |
Sets a custom stream to read data into.
function setStream ( MOAIHttpTaskBase self, MOAIStream stream )
self | ( MOAIHttpTaskBase ) |
stream | ( MOAIStream ) |
Sets the timeout for the task.
function setTimeout ( MOAIHttpTaskBase self, number timeout )
self | ( MOAIHttpTaskBase ) |
timeout | ( number ) |
Sets the URL for the task.
function setUrl ( MOAIHttpTaskBase self, string url )
self | ( MOAIHttpTaskBase ) |
url | ( string ) |
Sets the 'useragent' header for the task.
function setUserAgent ( MOAIHttpTaskBase self [, string useragent ] )
self | ( MOAIHttpTaskBase ) |
useragent | ( string ) Optional. Default value is "Moai SDK beta; support |
Sets the HTTP verb.
function setVerb ( MOAIHttpTaskBase self, number verb )
self | ( MOAIHttpTaskBase ) |
verb | ( number ) One of MOAIHttpTaskBase.HTTP_GET, MOAIHttpTaskBase.HTTP_HEAD, MOAIHttpTaskBase.HTTP_POST, MOAIHttpTaskBase.HTTP_PUT, MOAIHttpTaskBase.HTTP_DELETE |
Sets the task implementation to print out debug information (if any).
function setVerbose ( MOAIHttpTaskBase self [, boolean verbose ] )
self | ( MOAIHttpTaskBase ) |
verbose | ( boolean ) Optional. Default value is false. |