Types
HTTP server data types. More...
Data Structures | |
struct | http_server_param_t |
HTTP GET/POST request parameter. More... | |
struct | http_server_header_t |
HTTP request header. More... | |
struct | http_server_dynamic_page_t |
Dynamic URL callback context. More... | |
struct | http_server_tls_client_t |
Information about connected TLS clients. More... | |
Typedefs | |
typedef void * | http_server_request_t |
Internal HTTP server request context. | |
typedef zos_result_t(* | http_server_request_processor_t) (const http_server_request_t *request, const char *arg) |
Dynamic URL callback prototype. More... | |
typedef zos_bool_t(* | http_custom_header_callback_t) (const char *key, const char *value) |
Custom header processing callback prototype. More... | |
typedef zos_bool_t(* | http_server_authorize_callback_t) (const char *username, const char *password) |
Authorize client credentials callback prototype. More... | |
typedef void(* | http_server_not_found_callback_t) (const http_server_request_t *request) |
Requested URL not found callback prototype. More... | |
Enumerations | |
enum | http_server_header_flag_t { HTTP_SERVER_HEADER_NONE = 0, HTTP_SERVER_HEADER_GZIP = (1 << 0), HTTP_SERVER_HEADER_CACHE = (1 << 1) } |
Additional HTTP response header flags used by zn_hs_write_reply_header() More... | |
enum | http_server_method_t { HTTP_METHOD_GET = 0, HTTP_METHOD_POST = 1, HTTP_METHOD_HEAD = 2, HTTP_METHOD_DELETE = 3, HTTP_METHOD_OPTIONS = 4, HTTP_METHOD_PUT = 5 } |
HTTP request methods. More... | |
enum | http_server_request_header_t { HTTP_REQUEST_USER_AGENT, HTTP_REQUEST_TRANSFER_ENCODING, HTTP_REQUEST_CONTENT_TYPE, HTTP_REQUEST_AUTHORIZATION, HTTP_REQUEST_WS_KEY, HTTP_REQUEST_CONTENT_LENGTH } |
Default HTTP request header. More... | |
Detailed Description
HTTP server data types.
Typedef Documentation
typedef zos_bool_t(* http_custom_header_callback_t) (const char *key, const char *value) |
Custom header processing callback prototype.
This callback is called when the HTTP request is being parsed. It called for each custom HTTP request header encountered.
- Note
- The callback executes in the HTTP server thread context
- Parameters
-
[out] key
The header key [out] value
The header value
- Returns
- ZOS_TRUE if header should be stored with request context, ZOS_FALSE else
typedef zos_bool_t(* http_server_authorize_callback_t) (const char *username, const char *password) |
Authorize client credentials callback prototype.
If the HTTP request contain a 'Basic Authorization' header, this callback is called with the given username/password. This callback allows for denying unauthorized users.
- Note
- The callback executes in the HTTP server thread context
- Parameters
-
[out] username
Supplied username [out] password
Supplied password
- Returns
- ZOS_TRUE if user is authorized, ZOS_FALSE else
typedef void(* http_server_not_found_callback_t) (const http_server_request_t *request) |
Requested URL not found callback prototype.
This callback is called when the request URL route is not found.
- Note
- The callback executes in the HTTP server thread context
- Parameters
-
[out] request
Internal request context
typedef zos_result_t(* http_server_request_processor_t) (const http_server_request_t *request, const char *arg) |
Dynamic URL callback prototype.
- Note
- The callback executes in the HTTP server thread context
- Parameters
-
[out] request
Pointer to internal request context [out] arg
URL arguments (if callback was specified with 's' in URL)
- Returns
- zos_result_t result of processing request
Enumeration Type Documentation
Additional HTTP response header flags used by zn_hs_write_reply_header()
enum http_server_method_t |
Default HTTP request header.
By default the HTTP server will only store the following HTTTP request headers. To store custom headers use zn_hs_register_header_callback()