Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

httpd.h File Reference

httpd.h File Reference

HTTP server. More...

Go to the source code of this file.

Data Structures

struct  tCGI
 Structure defining the base filename (URL) of a CGI and the associated function which is to be called when that URL is requested. More...

Typedefs

typedef const char *(* tCGIHandler )(int iIndex, int iNumParams, char *pcParam[], char *pcValue[])
 Function pointer for a CGI script handler.
typedef u16_t(* tSSIHandler )(#if LWIP_HTTPD_SSI_RAW const char *ssi_tag_name,#elseint iIndex,#endifchar *pcInsert, int iInsertLen#if LWIP_HTTPD_SSI_MULTIPART, u16_t current_tag_part, u16_t *next_tag_part#endif#if defined(LWIP_HTTPD_FILE_STATE)&&LWIP_HTTPD_FILE_STATE, void *connection_state#endif)
 Function pointer for the SSI tag handler callback.

Functions

void httpd_cgi_handler (struct fs_file *file, 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 ( struct fs_file *  file,
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 the object passed as connection_state, which is allocated to file->state via fs_state_init() from fs_open() or fs_open_custom(). Content creation via SSI or complete dynamic files can retrieve the CGI params from there.