|
void | ltrx_ajax_end_response (struct ltrx_http_client *client) |
| ltrx_ajax_end_response construct the ending of an ajax response. More...
|
|
void | ltrx_ajax_register (const struct ltrx_http_ajax *ajaxDef) |
| ltrx_ajax_register registers a callback function for a specific URL. More...
|
|
void | ltrx_ajax_send_xml_end (struct ltrx_http_client *client) |
| ltrx_ajax_send_xml_end sends the end of a xml level in an ajax response. More...
|
|
void | ltrx_ajax_send_xml_node_end (struct ltrx_http_client *client, const char *target) |
| ltrx_ajax_send_xml_node_end sends the end of a raw xml node in an ajax response. More...
|
|
void | ltrx_ajax_send_xml_node_start (struct ltrx_http_client *client, const char *target) |
| ltrx_ajax_send_xml_node_start sends the start of a raw xml node in an ajax response. More...
|
|
void | ltrx_ajax_send_xml_node_unsigned (struct ltrx_http_client *client, const char *target, uint32_t value) |
| ltrx_ajax_send_xml_node_unsigned sends the a xml node with an unsigned integer value. More...
|
|
void | ltrx_ajax_send_xml_start (struct ltrx_http_client *client, const char *target, const char *attribute) |
| ltrx_ajax_send_xml_start sends the start of a xml level in an ajax response. More...
|
|
void | ltrx_ajax_start_response (struct ltrx_http_client *client) |
| ltrx_ajax_start_response construct the start of an ajax response. More...
|
|
void | ltrx_http_dynamic_callback_register (const struct ltrx_http_dynamic_callback *hdc) |
| Register a dynamic callback. More...
|
|
void | ltrx_http_error (struct ltrx_http_client *pClient) |
| Declares an error on the HTTP client. More...
|
|
enum ltrx_http_header_content_type | ltrx_http_get_content_type (struct ltrx_http_client *client) |
| Get content type. More...
|
|
enum ltrx_http_header_method | ltrx_http_get_header_method (const struct ltrx_http_client *client) |
| Get header method. More...
|
|
const char * | ltrx_http_get_request_path (const struct ltrx_http_client *client) |
| Retrieves the HTTP request path for the current HTTP client. More...
|
|
const char * | ltrx_http_get_request_query_data (const struct ltrx_http_client *client) |
| Retrieves the complete HTTP GET request query string. More...
|
|
bool | ltrx_http_multipart_process (struct ltrx_http_client *client, struct ltrx_http_query_data *query_data[], bool(*unknownKeyHandler)(struct ltrx_http_client *client, struct ltrx_http_multipart_parse_data *pMultipart_Data, const char *key, const char *attribute_key, void *arg), void *arg, struct ltrx_write_user_message_info *lwumi) |
| Process key/value parameters in HTTP POST request multipart/form-data body. More...
|
|
int | ltrx_http_multipart_read_char (struct ltrx_http_client *client, struct ltrx_http_multipart_parse_data *pData) |
| Reads a single character from a multipart stream. More...
|
|
int | ltrx_http_read_char_from_body_stream (struct ltrx_http_client *client) |
| Reads a single character from the body stream. More...
|
|
void | ltrx_http_send_data_encoded (struct ltrx_http_client *client, const char *data) |
| Encodes and sends data to the HTTP client. More...
|
|
void | ltrx_http_send_data_flush (struct ltrx_http_client *client) |
| Pushes out any pending data to the HTTP client. More...
|
|
Definitions related to HTTP server.
void ltrx_ajax_register |
( |
const struct ltrx_http_ajax * |
ajaxDef | ) |
|
ltrx_ajax_register registers a callback function for a specific URL.
- Parameters
-
ajaxDef | Static struct containing registerName and callback |
- Usage/Comments:
- Callback is only invoked in the following situations: 1) If registerName starts with '/', an HTTP GET request for http://<hostname>/ajax/<registerName> will invoke callback. 2) Otherwise, an HTTP POST request for http://<hostname>/ with the first post parameter ajax=<registerName> will invoke callback.
Note: The support of HTTP POST is the same ajax framework like in Nuevo products. The support of HTTP GET is a short cut to allow more generic support for HTTP GET request. Forming a HTTP GET request technically does not require any of our ajax framework (ajax.js). Therefore, callback invoked can stream any data format as long as user's javascript callback knows how to process it. (We probably need some more touchup to complete the generic support like raw httpWrite, forming httpHeader, etc.). We may want to create separate api to register generic get/post request and cleanup this shortcut in the future. In our internal webpages, we have tied it to PollData (ajax.js) to allow pure data being returned without invoking any javascript function (processResponse in ajax.js). Although we still forms the response with <ajax> (ltrx_ajax_start_response), our js callback really does not care about it and it is only interested in the data in the response.