![]() |
MHEG5
18.9.0
MHEG5 Documentation
|
Manages the interface between HTTP component and platform. More...
Go to the source code of this file.
Enumerations | |
enum | E_HttpRequestType { HTTP_REQUEST_GET, HTTP_REQUEST_HEAD, HTTP_REQUEST_POST, HTTP_REQUEST_STREAM } |
Functions | |
E_HttpErr | HP_Initialise (void) |
Initialise the HTTP interface. More... | |
E_HttpErr | HP_SetUserAgent (U8BIT *user_agent) |
Set user agent for HTTP client. More... | |
E_HttpErr | HP_SetTimeout (U16BIT timeout) |
Set timeout (in seconds) for HTTP requests. The timeout applies to connections (i.e. the time it takes to connect to the server) as well as response time (i.e the time it takes to download the content). Between sending the request and receiving the first byte of the the response there is no timeout. More... | |
E_HttpErr | HP_CreateRequest (U8BIT *url, E_HttpRequestType type, void **handle) |
Create an HTTP request. The URL is provided, and is guaranteed to be either "http://..." or "https://..." The request type is also provided. Streaming request is the same as a GET request, except that a "Range:" header is also allowed for it. More... | |
E_HttpErr | HP_StartRequest (void *handle) |
Start an HTTP request. More... | |
E_HttpErr | HP_ResumeRequest (void *handle) |
Resume an HTTP request. More... | |
E_HttpErr | HP_StopRequest (void *handle) |
Stop an HTTP request. More... | |
E_HttpErr | HP_DestroyRequest (void *handle) |
Destroy an HTTP request. More... | |
E_HttpErr | HP_SetUserData (void *handle, void *userdata) |
Set user data associated with an HTTP request. More... | |
E_HttpErr | HP_AddHeader (void *handle, U8BIT *header) |
Add HTTP header to HTTP request. More... | |
E_HttpErr | HP_SetPostData (void *handle, U8BIT *postdata) |
Set POST data for an HTTP request. More... | |
E_HttpErr | HP_SetRange (void *handle, U8BIT *range) |
Set "Range:" header for an HTTP request. More... | |
E_HttpErr | HP_GetRedirectUrl (void *handle, U8BIT **url) |
Get redirection URL for HTTP request. More... | |
E_HttpErr | HP_AddTlsCertificate (U8BIT *cert, U32BIT len) |
Add a certificate for TLS connections. More... | |
E_HttpErr | HP_ClearTlsCertificates (void) |
Clear TLS certificates. More... | |
E_HttpErr | HP_WaitForAction (void) |
Wait until there is some activity on one (or more) of the HTTP requests, or until some other condition is met. The exact details depend on the HTTP client. More... | |
E_HttpErr | HP_Process (U16BIT *active_count) |
Process HTTP requests. This may cause request callbacks to be called. More... | |
void | HP_HeaderCallback (void *userdata, S32BIT response_code, U8BIT *data, U32BIT len) |
Callback for HTTP header data. This function is called by the HTTP client. More... | |
BOOLEAN | HP_ContentCallback (void *userdata, U8BIT *data, U32BIT len) |
Callback for HTTP content data. This function is called by the HTTP client. The callback must return TRUE if the content has been processed. If FALSE is returned, the HTTP client pauses the request and does not deliver any more data until the request is resumed. More... | |
void | HP_EndCallback (void *userdata, E_HttpStatus status) |
Callback for HTTP request end. This function is called by the HTTP client. More... | |
E_HttpErr | HP_Terminate (void) |
Terminate the HTTP interface. More... | |
Manages the interface between HTTP component and platform.
Definition in file http_platform.h.
enum E_HttpRequestType |
Enumerator | |
---|---|
HTTP_REQUEST_GET | |
HTTP_REQUEST_HEAD | |
HTTP_REQUEST_POST | |
HTTP_REQUEST_STREAM |
Definition at line 40 of file http_platform.h.
Add HTTP header to HTTP request.
handle | The handle of the request |
header | Header to add (null-terminated string) |
Definition at line 499 of file curlInterface.c.
Add a certificate for TLS connections.
cert | Certificate data (X.509 DER format) |
len | Certificate length |
Definition at line 642 of file curlInterface.c.
E_HttpErr HP_ClearTlsCertificates | ( | void | ) |
Clear TLS certificates.
Definition at line 694 of file curlInterface.c.
Callback for HTTP content data. This function is called by the HTTP client. The callback must return TRUE if the content has been processed. If FALSE is returned, the HTTP client pauses the request and does not deliver any more data until the request is resumed.
userdata | User data for the HTTP request |
data | Content block data |
len | Content block length |
E_HttpErr HP_CreateRequest | ( | U8BIT * | url, |
E_HttpRequestType | type, | ||
void ** | handle | ||
) |
Create an HTTP request. The URL is provided, and is guaranteed to be either "http://..." or "https://..." The request type is also provided. Streaming request is the same as a GET request, except that a "Range:" header is also allowed for it.
url | URL for request |
type | Request type |
handle | New request handle, or NULL if it cannot be created |
Definition at line 187 of file curlInterface.c.
E_HttpErr HP_DestroyRequest | ( | void * | handle | ) |
Destroy an HTTP request.
handle | The handle of the request to destroy |
Definition at line 420 of file curlInterface.c.
void HP_EndCallback | ( | void * | userdata, |
E_HttpStatus | status | ||
) |
Callback for HTTP request end. This function is called by the HTTP client.
userdata | User data for the HTTP request |
status | HTTP request status |
Get redirection URL for HTTP request.
handle | The handle of the HTTP request |
url | Redirection URL |
Definition at line 605 of file curlInterface.c.
Callback for HTTP header data. This function is called by the HTTP client.
userdata | User data for the HTTP request |
response_code | HTTP response code |
data | HTTP header data |
len | HTTP header length |
E_HttpErr HP_Initialise | ( | void | ) |
Initialise the HTTP interface.
Definition at line 111 of file curlInterface.c.
Process HTTP requests. This may cause request callbacks to be called.
active_count | Number of active requests |
Definition at line 769 of file curlInterface.c.
E_HttpErr HP_ResumeRequest | ( | void * | handle | ) |
Resume an HTTP request.
handle | The handle of the request to resume |
Definition at line 345 of file curlInterface.c.
Set POST data for an HTTP request.
handle | The handle of the request |
postdata | Null-terminated string containing the POST data |
Definition at line 535 of file curlInterface.c.
Set "Range:" header for an HTTP request.
handle | The handle of the request |
range | Null-terminated string containing the range details |
Definition at line 574 of file curlInterface.c.
Set timeout (in seconds) for HTTP requests. The timeout applies to connections (i.e. the time it takes to connect to the server) as well as response time (i.e the time it takes to download the content). Between sending the request and receiving the first byte of the the response there is no timeout.
timeout | Request timeout in seconds |
Definition at line 163 of file curlInterface.c.
Set user agent for HTTP client.
user_agent | User agent string |
user_agent | User agent string |
Definition at line 140 of file curlInterface.c.
E_HttpErr HP_SetUserData | ( | void * | handle, |
void * | userdata | ||
) |
Set user data associated with an HTTP request.
handle | The handle of the request |
userdata | User data to be associated with the request |
Definition at line 464 of file curlInterface.c.
E_HttpErr HP_StartRequest | ( | void * | handle | ) |
Start an HTTP request.
handle | The handle of the request to start |
Definition at line 285 of file curlInterface.c.
E_HttpErr HP_StopRequest | ( | void * | handle | ) |
Stop an HTTP request.
handle | The handle of the request to stop |
Definition at line 386 of file curlInterface.c.
E_HttpErr HP_Terminate | ( | void | ) |
Terminate the HTTP interface.
Definition at line 856 of file curlInterface.c.
E_HttpErr HP_WaitForAction | ( | void | ) |
Wait until there is some activity on one (or more) of the HTTP requests, or until some other condition is met. The exact details depend on the HTTP client.
Definition at line 724 of file curlInterface.c.