cueOS  2.4
cueOS - Universal Show Control OS for ARM
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
http_response.h
1
9#ifndef HTTP_RESPONSE_H_
10#define HTTP_RESPONSE_H_
11
12#include <stdint.h>
13#include <stdlib.h>
14#include "http_defs.h"
15
16
17#define HTTP_RESPONSE_CONTENT_LENGTH_MAX_LENGTH 5
26typedef enum{
30
31
35typedef struct {
36 char *data_ptr;
37 uint32_t data_ptr_index;
38 uint32_t data_len;
39 uint8_t is_static;
41
42
46void http_response_prepare_dynamic(http_response_s *res, http_status_code_e status_code, http_content_types_e content_type, char *content);
47
48#endif
49
http_status_code_e
Enumeration of HTTP status codes string indexes.
Definition: http_defs.h:21
http_content_types_e
Enumeration of HTTP content-types header values string indexes.
Definition: http_defs.h:53
uint32_t http_response_get_bytes_left(http_response_s *res)
Returns the amount of bytes left to be processed.
Definition: http_response.c:84
http_response_s * http_response_new(void)
Creates a new HTTP response instance.
Definition: http_response.c:43
http_response_static_state
Whether the HTTP response conveys static data or not. This is very importnt as it will be used to all...
Definition: http_response.h:26
void http_response_prepare_dynamic(http_response_s *res, http_status_code_e status_code, http_content_types_e content_type, char *content)
Pre-formats response to HTTP response using provided response header parameters.
void http_response_free(http_response_s *res)
Safely frees an HTTP response instance.
Definition: http_response.c:61
@ HTTP_RESPONSE_IS_DYNAMIC
Definition: http_response.h:27
@ HTTP_RESPONSE_IS_STATIC
Definition: http_response.h:28
HTTP response structure object.
Definition: http_response.h:35
uint32_t data_len
Definition: http_response.h:38
uint32_t data_ptr_index
Definition: http_response.h:37