Sun Java System Access Manager 7.1 C API Reference

am_web_get_request_url()

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.

Syntax

#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);

Parameters

This function takes the following parameters:

host_hdr

Pointer to the host header string of the HTTP request as passed from the browser.

protocol

Pointer to the protocol used by the web container of the resource being requested.

hostname

Pointer to the name of the host on which the resource being requested.

port

Value based on the size_t defined in the standard <stddef.h> header file that reflects the port number of the resource being requested.

uri

Pointer to the URI of the HTTP request.


Note –

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.


query

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.

req_url

Pointer to a pointer to the OUT parameter to be populated with the value of the URL string to be used by the agent.

Returns

This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):

AM_SUCCESS

If the query parameter was found in the URL.

AM_*

If any other error occurred.