Parses the host request header field for a server host name, port, protocol, query parameter, and URI to return the requested URL to the web agent.
#include "am_web.h" AM_WEB_EXPORT am_status_t am_web_get_request_url(const char *host_hdr, const char *protocol, const char *hostname, size_t port, const char *uri, const char *query, char **req_url);
This function takes the following parameters:
Pointer to the host header string of the HTTP request as passed from the browser.
Pointer to the protocol used by the web container of the resource being requested.
Pointer to the name of the host on which the resource being requested.
Value based on the size_t defined in the standard <stddef.h> header file that reflects the port number of the resource being requested.
Pointer to the URI of the HTTP request.
Most URLs have this basic form: protocol://server:port/request-URI. The request-URI portion of the URL is used by the web server to identify the document.
The query string appended to the request URL, if any. For example, if the URL is http://www.example.com?a=b&c=d, the value of this parameter would be a=b&c=d.
Pointer to a pointer to the OUT parameter to be populated with the value of the URL string to be used by the agent.
This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
If the query parameter was found in the URL.
If any other error occurred.