Murl Engine Lua Addon API  Version 1.0 beta
Murl.IUrlRequest

The url request interface.

The IUrlRequest object can be created by the IWebControl object.


Table members

Methods


SendGet(url, timeout)

Send a url-request with http method GET. When posting a url-request the IsPending() state is true. If the url-request was successful the WasFinished() state is true and the response data can be accessed by GetResponseData().

Boolean SendGet(String url, Number timeout)

Parameters
urlThe url string to send to.
timeoutThe request timeout in seconds.
Returns
Boolean true if successful.

SendPost(url, body, contentType, timeout)

Send a url-request with http method POST. When posting a url-request the IsPending() state is true. If the url-request was successful the WasFinished() state is true and the response data can be accessed by GetResponseData().
If the url is redirected, the POST is cancelled and WasRejected() state is true.

Boolean SendPost(String url, Murl.Data body, String contentType, Number timeout)

Parameters
urlThe url string to send to.
bodyThe body data to send.
contentTypeThe string for the "Content-Type" http header field.
timeoutThe request timeout in seconds.
Returns
Boolean true if successful.

GetUrlString()

Get the url-request string.

String GetUrlString()

Returns
String The url which was passed to SendGet() or SendPost().

GetResponseData()

Get the url-request response data. The data is available if WasFinished() returns true.

Murl.Data GetResponseData()

Returns
Murl.Data The url-request response data.

GetCurrentDataSize()

Get the current response data size. The size is updated while receiving data asynchronous.

Integer GetCurrentDataSize()

Returns
Integer The current response data byte size.

ReleaseData()

Release the response data. Releasing the data can be performed only if the url-request is not pending.

Boolean ReleaseData()

Returns
Boolean true if successful.

IsPending()

Check if the url-request is pending.

Boolean IsPending()

Returns
Boolean true if the url-request is pending.

WasFinished()

Check if the url-request was finished in the most recent tick.

Boolean WasFinished()

Returns
Boolean true if the url-request was finished in the most recent tick.

WasRejected()

Check if the url-request was rejected in the most recent tick.

Boolean WasRejected()

Returns
Boolean true if the url-request was rejected in the most recent tick.