Murl::IUrlRequest Interface Referenceabstract

The url request interface. More...

#include "murl_i_url_request.h"

Inherited by Murl::Platform::Android::UrlRequest, Murl::Platform::Foundation::UrlRequest, and Murl::Platform::Win32::UrlRequest.

Public Member Functions

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 StringGetUrlString () const =0
 Get the url-request string. More...
 
virtual const DataGetResponseData () const =0
 Get the url-request response data. 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...
 

Detailed Description

The url request interface.

The IUrlRequest object can be created by the IWebControl object.

Member Function Documentation

◆ SendGet()

virtual Bool Murl::IUrlRequest::SendGet ( const String url,
Double  timeout = 60 
)
pure virtual

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().

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

◆ SendPost()

virtual Bool Murl::IUrlRequest::SendPost ( const String url,
const Data body,
const String contentType,
Double  timeout = 60 
)
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.

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
true if successful.

◆ GetUrlString()

virtual const String& Murl::IUrlRequest::GetUrlString ( ) const
pure virtual

Get the url-request string.

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

◆ GetResponseData()

virtual const Data& Murl::IUrlRequest::GetResponseData ( ) const
pure virtual

Get the url-request response data.

The data is available if WasFinished() returns true.

Returns
The url-request response data.

◆ GetCurrentDataSize()

virtual UInt64 Murl::IUrlRequest::GetCurrentDataSize ( ) const
pure virtual

Get the current response data size.

The size is updated while receiving data asynchronous.

Returns
The current response data byte size.

◆ ReleaseData()

virtual Bool Murl::IUrlRequest::ReleaseData ( )
pure virtual

Release the response data.

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

Returns
true if successful.

◆ IsPending()

virtual Bool Murl::IUrlRequest::IsPending ( ) const
pure virtual

Check if the url-request is pending.

Returns
true if the url-request is pending.

◆ WasFinished()

virtual Bool Murl::IUrlRequest::WasFinished ( ) const
pure virtual

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

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

◆ WasRejected()

virtual Bool Murl::IUrlRequest::WasRejected ( ) const
pure virtual

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

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

The documentation for this interface was generated from the following file:
  • murl_i_url_request.h


Copyright © 2011-2017 Spraylight GmbH.