![]() |
AXHttp
|
The AXHttpHandler
handles HTTP requests and responses.
More...
Go to the source code of this file.
Typedefs | |
typedef struct _AXHttpHandler | AXHttpHandler |
The AXHttpHandler is an opaque data type used to manage the HTTP API. | |
typedef void(* | AXHttpRequestHandler) (const gchar *path, const gchar *method, const gchar *query, GHashTable *params, GOutputStream *output_stream, gpointer user_data) |
This is the prototype of the callback function called whenever a request is made for a registered CGI. The reply must apply to the rules outlined in RFC 3875. If the reply does not comply with RFC 3875 the connection to the client will be terminated and SIGPIPE will be raised. More... | |
Functions | |
AXHttpHandler * | ax_http_handler_new (AXHttpRequestHandler request_handler, gpointer user_data) |
Initializes a new AXHttpHandler and registers all CGIs listed in the CGI configuration file. More... | |
void | ax_http_handler_free (AXHttpHandler *handler) |
Frees an AXHttpHandler an releases all associated resources. More... | |
The AXHttpHandler
handles HTTP requests and responses.
typedef void(* AXHttpRequestHandler) (const gchar *path, const gchar *method, const gchar *query, GHashTable *params, GOutputStream *output_stream, gpointer user_data) |
This is the prototype of the callback function called whenever a request is made for a registered CGI. The reply must apply to the rules outlined in RFC 3875. If the reply does not comply with RFC 3875 the connection to the client will be terminated and SIGPIPE will be raised.
path | The path of the requested CGI. |
method | The method used in the request, either "GET" or "POST" |
query | For a "GET" request, the unmodified query supplied to the CGI. For a "POST" request, the complete message body. |
params | A GHashTable containing the query parsed into keys and values. Only applicable to "GET" requests or "POST" requests with "Content-Type: application/x-www-form-urlencoded". |
output_stream | An output stream to post replies on. It's the responsibility of the client to unreference the output stream before returning from the callback. |
user_data | The user data pointer supplied to ax_http_handler_new . |
AXHttpHandler* ax_http_handler_new | ( | AXHttpRequestHandler | request_handler, |
gpointer | user_data | ||
) |
Initializes a new AXHttpHandler
and registers all CGIs listed in the CGI configuration file.
request_handler | The callback function to call when a request for a CGI is made. |
user_data | A pointer that will be supplied with the call to the request_handler . |
NULL
. References ax_http_handler_free(), and ax_http_server_socket_new().
void ax_http_handler_free | ( | AXHttpHandler * | http_handler | ) |
Frees an AXHttpHandler
an releases all associated resources.
handler | A previously created AXHttpHandler . |
References ax_http_server_socket_free().
Referenced by ax_http_handler_new().