Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BLE_file_test BLE_Blink ExternalEncoder
httpd.h File Reference
HTTP server. More...
Go to the source code of this file.
Functions | |
| void | httpd_cgi_handler (const char *uri, int iNumParams, char **pcParam, char **pcValue#if defined(LWIP_HTTPD_FILE_STATE)&&LWIP_HTTPD_FILE_STATE, void *connection_state#endif) |
| Define this generic CGI handler in your application. | |
| void | http_set_ssi_handler (tSSIHandler pfnSSIHandler, const char **ppcTags, int iNumTags) |
| Set the SSI handler function (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used) | |
| err_t | httpd_post_begin (void *connection, const char *uri, const char *http_request, u16_t http_request_len, int content_len, char *response_uri, u16_t response_uri_len, u8_t *post_auto_wnd) |
| Called when a POST request has been received. | |
| err_t | httpd_post_receive_data (void *connection, struct pbuf *p) |
| Called for each pbuf of data that has been received for a POST. | |
| void | httpd_post_finished (void *connection, char *response_uri, u16_t response_uri_len) |
| Called when all data is received or when the connection is closed. | |
Detailed Description
HTTP server.
Definition in file httpd.h.
Function Documentation
| void http_set_ssi_handler | ( | tSSIHandler | pfnSSIHandler, |
| const char ** | ppcTags, | ||
| int | iNumTags | ||
| ) |
Set the SSI handler function (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used)
| void httpd_cgi_handler | ( | const char * | uri, |
| int | iNumParams, | ||
| char ** | pcParam, | ||
| char **pcValue#if defined(LWIP_HTTPD_FILE_STATE)&& | LWIP_HTTPD_FILE_STATE, | ||
| void *connection_state# | endif | ||
| ) |
Define this generic CGI handler in your application.
It is called once for every URI with parameters. The parameters can be stored to
| err_t httpd_post_begin | ( | void * | connection, |
| const char * | uri, | ||
| const char * | http_request, | ||
| u16_t | http_request_len, | ||
| int | content_len, | ||
| char * | response_uri, | ||
| u16_t | response_uri_len, | ||
| u8_t * | post_auto_wnd | ||
| ) |
Called when a POST request has been received.
The application can decide whether to accept it or not.
- Parameters:
-
connection Unique connection identifier, valid until httpd_post_end is called. uri The HTTP header URI receiving the POST request. http_request The raw HTTP request (the first packet, normally). http_request_len Size of 'http_request'. content_len Content-Length from HTTP header. response_uri Filename of response file, to be filled when denying the request response_uri_len Size of the 'response_uri' buffer. post_auto_wnd Set this to 0 to let the callback code handle window updates by calling 'httpd_post_data_recved' (to throttle rx speed) default is 1 (httpd handles window updates automatically)
- Returns:
- ERR_OK: Accept the POST request, data may be passed in another err_t: Deny the POST request, send back 'bad request'.
| void httpd_post_finished | ( | void * | connection, |
| char * | response_uri, | ||
| u16_t | response_uri_len | ||
| ) |
Called when all data is received or when the connection is closed.
The application must return the filename/URI of a file to send in response to this POST request. If the response_uri buffer is untouched, a 404 response is returned.
- Parameters:
-
connection Unique connection identifier. response_uri Filename of response file, to be filled when denying the request response_uri_len Size of the 'response_uri' buffer.
Called for each pbuf of data that has been received for a POST.
ATTENTION: The application is responsible for freeing the pbufs passed in!
- Parameters:
-
connection Unique connection identifier. p Received data.
- Returns:
- ERR_OK: Data accepted. another err_t: Data denied, http_post_get_response_uri will be called.
Generated on Tue Jul 12 2022 15:19:59 by
1.7.2