![]() |
Murl Engine API
Version 2018.3
|
The url request interface. More...
#include <murl_i_url_request.h>
The url request interface.
The IUrlRequest object can be created by the IWebControl object.
Inherited by Murl::Platform::Android::UrlRequest, Murl::Platform::Emscripten::UrlRequest, Murl::Platform::Foundation::UrlRequest, and Murl::Platform::Win32::UrlRequest.
Public Member Functions | |
virtual Bool | SetHeaders (const Map< String, String > &headers)=0 |
Define custom HTTP headers for the request. More... | |
virtual Bool | ClearHeaders ()=0 |
Clear any custom HTTP headers for the request. More... | |
virtual Bool | SendGet (const String &url, Double timeout=60)=0 |
Send a url-request with http method GET. More... | |
virtual Bool | SendPost (const String &url, const Data &body, const String &contentType, Double timeout=60)=0 |
Send a url-request with http method POST. More... | |
virtual const Map< String, String > & | GetHeaders () const =0 |
Get the custom HTTP headers defined for this request. More... | |
virtual const String & | GetUrlString () const =0 |
Get the url-request string. More... | |
virtual const Data & | GetResponseData () const =0 |
Get the url-request response data. More... | |
virtual const Map< String, String > & | GetResponseHeaders () const =0 |
Get the HTTP headers received with this URL request's response. More... | |
virtual UInt64 | GetCurrentDataSize () const =0 |
Get the current response data size. More... | |
virtual Bool | ReleaseData ()=0 |
Release the response data. More... | |
virtual Bool | IsPending () const =0 |
Check if the url-request is pending. More... | |
virtual Bool | WasFinished () const =0 |
Check if the url-request was finished in the most recent tick. More... | |
virtual Bool | WasRejected () const =0 |
Check if the url-request was rejected in the most recent tick. More... | |
Define custom HTTP headers for the request.
This method can be used to define any number of custom HTTP headers sent with the URL request, given as a map containing string key/value pairs for the header names and values, respectively. Note: When using a POST request, the given headers should not include the "Content-Type" and "Content-Length" headers, as they are automatically added during SendPost().
headers | The map of header key/value pairs. |
|
pure virtual |
Clear any custom HTTP headers for the request.
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().
url | The url string to send to. |
timeout | The request timeout in seconds. |
|
pure virtual |
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.
url | The url string to send to. |
body | The body data to send. |
contentType | The string for the "Content-Type" http header field. |
timeout | The request timeout in seconds. |
Get the custom HTTP headers defined for this request.
|
pure virtual |
Get the url-request string.
|
pure virtual |
Get the url-request response data.
The data is available if WasFinished() returns true.
Get the HTTP headers received with this URL request's response.
The headers are available if WasFinished() returns true.
|
pure virtual |
Get the current response data size.
The size is updated while receiving data asynchronous.
|
pure virtual |
Release the response data.
Releasing the data can be performed only if the url-request is not pending.
|
pure virtual |
Check if the url-request is pending.
|
pure virtual |
Check if the url-request was finished in the most recent tick.
|
pure virtual |
Check if the url-request was rejected in the most recent tick.