29#include <mstdlib/base/m_defs.h>
30#include <mstdlib/base/m_types.h>
31#include <mstdlib/base/m_list_str.h>
32#include <mstdlib/base/m_hash_multi.h>
33#include <mstdlib/base/m_parser.h>
34#include <mstdlib/base/m_buf.h>
35#include <mstdlib/text/m_textcodec.h>
1260 const char *host,
unsigned short port,
const char *uri,
1261 const char *user_agent,
const char *content_type,
const M_hash_dict_t *headers,
1262 const unsigned char *data,
size_t data_len,
const char *charset,
size_t *len);
1290 const char *host,
unsigned short port,
const char *uri,
1291 const char *user_agent,
const char *content_type,
const M_hash_dict_t *headers,
1292 const unsigned char *data,
size_t data_len,
const char *charset);
1321 const char *content_type,
const M_hash_dict_t *headers,
const unsigned char *data,
size_t data_len,
1322 const char *charset,
size_t *len);
1345 const char *content_type,
const M_hash_dict_t *headers,
const unsigned char *data,
size_t data_len,
1346 const char *charset);
struct M_buf M_buf_t
Definition: m_buf.h:77
struct M_hash_dict M_hash_dict_t
Definition: m_hash_dict.h:52
M_http_reader_chunk_data_done_func chunk_data_done_func
Definition: m_http.h:677
M_http_reader_multipart_data_func multipart_data_func
Definition: m_http.h:684
M_http_reader_trailer_full_func trailer_full_func
Definition: m_http.h:689
M_http_reader_header_done_func header_done_func
Definition: m_http.h:671
M_http_reader_body_func body_func
Definition: m_http.h:672
M_http_reader_chunk_extensions_func chunk_extensions_func
Definition: m_http.h:674
M_http_reader_chunk_extensions_done_func chunk_extensions_done_func
Definition: m_http.h:675
M_http_reader_trailer_done_func trailer_done_func
Definition: m_http.h:691
M_http_reader_trailer_func trailer_func
Definition: m_http.h:690
M_http_reader_header_full_func header_full_func
Definition: m_http.h:669
M_http_reader_multipart_header_done_func multipart_header_done_func
Definition: m_http.h:683
M_http_reader_multipart_epilouge_done_func multipart_epilouge_done_func
Definition: m_http.h:688
M_http_reader_chunk_data_finished_func chunk_data_finished_func
Definition: m_http.h:678
M_http_reader_multipart_preamble_func multipart_preamble_func
Definition: m_http.h:679
M_http_reader_multipart_data_done_func multipart_data_done_func
Definition: m_http.h:685
M_http_reader_header_func header_func
Definition: m_http.h:670
M_http_reader_multipart_data_finished_func multipart_data_finished_func
Definition: m_http.h:686
M_http_reader_start_func start_func
Definition: m_http.h:668
M_http_reader_multipart_preamble_done_func multipart_preamble_done_func
Definition: m_http.h:680
M_http_reader_multipart_header_func multipart_header_func
Definition: m_http.h:682
M_http_reader_body_done_func body_done_func
Definition: m_http.h:673
M_http_reader_multipart_header_full_func multipart_header_full_func
Definition: m_http.h:681
M_http_reader_multipart_epilouge_func multipart_epilouge_func
Definition: m_http.h:687
M_http_reader_chunk_data_func chunk_data_func
Definition: m_http.h:676
M_http_error_t(* M_http_reader_body_func)(const unsigned char *data, size_t len, void *thunk)
Definition: m_http.h:411
M_http_error_t(* M_http_reader_multipart_header_done_func)(size_t idx, void *thunk)
Definition: m_http.h:550
M_http_error_t(* M_http_reader_header_func)(const char *key, const char *val, void *thunk)
Definition: m_http.h:392
struct M_http_reader M_http_reader_t
Definition: m_http.h:334
void M_http_reader_destroy(M_http_reader_t *httpr)
M_http_error_t(* M_http_reader_chunk_data_done_func)(size_t idx, void *thunk)
Definition: m_http.h:465
M_http_reader_t * M_http_reader_create(struct M_http_reader_callbacks *cbs, M_uint32 flags, void *thunk)
M_http_error_t(* M_http_reader_multipart_header_full_func)(const char *key, const char *val, size_t idx, void *thunk)
Definition: m_http.h:518
M_http_error_t M_http_reader_read(M_http_reader_t *httpr, const unsigned char *data, size_t data_len, size_t *len_read)
M_http_error_t(* M_http_reader_multipart_data_done_func)(size_t idx, void *thunk)
Definition: m_http.h:570
M_http_error_t(* M_http_reader_header_done_func)(M_http_data_format_t format, void *thunk)
Definition: m_http.h:401
M_http_reader_flags_t
Definition: m_http.h:660
M_http_error_t(* M_http_reader_multipart_preamble_done_func)(void *thunk)
Definition: m_http.h:497
M_http_error_t(* M_http_reader_trailer_func)(const char *key, const char *val, void *thunk)
Definition: m_http.h:644
M_http_error_t(* M_http_reader_chunk_data_finished_func)(void *thunk)
Definition: m_http.h:475
M_http_error_t(* M_http_reader_header_full_func)(const char *key, const char *val, void *thunk)
Definition: m_http.h:368
M_http_error_t(* M_http_reader_body_done_func)(void *thunk)
Definition: m_http.h:421
M_http_error_t(* M_http_reader_multipart_header_func)(const char *key, const char *val, size_t idx, void *thunk)
Definition: m_http.h:541
M_http_error_t(* M_http_reader_multipart_epilouge_done_func)(void *thunk)
Definition: m_http.h:602
M_http_error_t(* M_http_reader_trailer_full_func)(const char *key, const char *val, void *thunk)
Definition: m_http.h:622
M_http_error_t(* M_http_reader_multipart_data_finished_func)(void *thunk)
Definition: m_http.h:580
M_http_error_t(* M_http_reader_start_func)(M_http_message_type_t type, M_http_version_t version, M_http_method_t method, const char *uri, M_uint32 code, const char *reason, void *thunk)
Definition: m_http.h:348
M_http_error_t(* M_http_reader_chunk_data_func)(const unsigned char *data, size_t len, size_t idx, void *thunk)
Definition: m_http.h:456
M_http_error_t(* M_http_reader_chunk_extensions_done_func)(size_t idx, void *thunk)
Definition: m_http.h:445
M_http_error_t(* M_http_reader_multipart_data_func)(const unsigned char *data, size_t len, size_t idx, void *thunk)
Definition: m_http.h:561
M_http_error_t(* M_http_reader_trailer_done_func)(void *thunk)
Definition: m_http.h:654
M_http_error_t(* M_http_reader_multipart_epilouge_func)(const unsigned char *data, size_t len, void *thunk)
Definition: m_http.h:592
M_http_error_t(* M_http_reader_multipart_preamble_func)(const unsigned char *data, size_t len, void *thunk)
Definition: m_http.h:487
M_http_error_t(* M_http_reader_chunk_extensions_func)(const char *key, const char *val, size_t idx, void *thunk)
Definition: m_http.h:434
@ M_HTTP_READER_NONE
Definition: m_http.h:661
@ M_HTTP_READER_SKIP_START
Definition: m_http.h:662
M_hash_dict_t * M_http_simple_read_headers_dict(const M_http_simple_read_t *simple)
M_http_error_t M_http_simple_read(M_http_simple_read_t **simple, const unsigned char *data, size_t data_len, M_uint32 flags, size_t *len_read)
M_http_version_t M_http_simple_read_version(const M_http_simple_read_t *simple)
M_http_method_t M_http_simple_read_method(const M_http_simple_read_t *simple)
char * M_http_simple_read_header(const M_http_simple_read_t *simple, const char *key)
const char * M_http_simple_read_content_type(const M_http_simple_read_t *simple)
const char * M_http_simple_read_uri(const M_http_simple_read_t *simple)
M_textcodec_codec_t M_http_simple_read_codec(const M_http_simple_read_t *simple)
const char * M_http_simple_read_reason_phrase(const M_http_simple_read_t *simple)
const char * M_http_simple_read_query_string(const M_http_simple_read_t *simple)
M_list_str_t * M_http_simple_read_headers(const M_http_simple_read_t *simple)
M_bool M_http_simple_read_is_body_form_data(const M_http_simple_read_t *simple)
const M_list_str_t * M_http_simple_read_get_set_cookie(const M_http_simple_read_t *simple)
const unsigned char * M_http_simple_read_body(const M_http_simple_read_t *simple, size_t *len)
const char * M_http_simple_read_charset(const M_http_simple_read_t *simple)
M_bool M_http_simple_read_port(const M_http_simple_read_t *simple, M_uint16 *port)
struct M_http_simple_read M_http_simple_read_t
Definition: m_http.h:785
const char * M_http_simple_read_path(const M_http_simple_read_t *simple)
const M_hash_dict_t * M_http_simple_read_query_args(const M_http_simple_read_t *simple)
M_uint32 M_http_simple_read_status_code(const M_http_simple_read_t *simple)
void M_http_simple_read_destroy(M_http_simple_read_t *http)
M_http_simple_read_flags_t
Definition: m_http.h:788
M_http_error_t M_http_simple_read_parser(M_http_simple_read_t **simple, M_parser_t *parser, M_uint32 flags)
M_http_message_type_t M_http_simple_read_message_type(const M_http_simple_read_t *simple)
const M_hash_dict_t * M_http_simple_read_body_form_data(const M_http_simple_read_t *simple)
const char * M_http_simple_read_host(const M_http_simple_read_t *simple)
@ M_HTTP_SIMPLE_READ_FAIL_TRAILERS
Definition: m_http.h:793
@ M_HTTP_SIMPLE_READ_LEN_REQUIRED
Definition: m_http.h:791
@ M_HTTP_SIMPLE_READ_NONE
Definition: m_http.h:789
@ M_HTTP_SIMPLE_READ_FAIL_EXTENSION
Definition: m_http.h:792
@ M_HTTP_SIMPLE_READ_NODECODE_BODY
Definition: m_http.h:790
M_bool M_http_simple_write_response_buf(M_buf_t *buf, M_uint32 code, const char *reason, const char *content_type, const M_hash_dict_t *headers, const unsigned char *data, size_t data_len, const char *charset)
unsigned char * M_http_simple_write_request(M_http_method_t method, const char *host, unsigned short port, const char *uri, const char *user_agent, const char *content_type, const M_hash_dict_t *headers, const unsigned char *data, size_t data_len, const char *charset, size_t *len)
unsigned char * M_http_simple_write_response(M_uint32 code, const char *reason, const char *content_type, const M_hash_dict_t *headers, const unsigned char *data, size_t data_len, const char *charset, size_t *len)
M_bool M_http_simple_write_request_buf(M_buf_t *buf, M_http_method_t method, const char *host, unsigned short port, const char *uri, const char *user_agent, const char *content_type, const M_hash_dict_t *headers, const unsigned char *data, size_t data_len, const char *charset)
M_http_version_t M_http_version_from_str(const char *version)
char * M_http_generate_form_data_string(const M_hash_dict_t *params)
M_http_data_format_t
Definition: m_http.h:151
M_http_method_t M_http_method_from_str(const char *method)
M_bool M_http_generate_query_string_buf(M_buf_t *buf, const char *uri, const M_hash_dict_t *params)
const char * M_http_version_to_str(M_http_version_t version)
M_http_version_t
Definition: m_http.h:128
M_hash_dict_t * M_http_parse_query_string(const char *data, M_textcodec_codec_t codec)
M_http_error_t
Definition: m_http.h:84
M_http_method_t
Definition: m_http.h:136
M_bool M_http_generate_form_data_string_buf(M_buf_t *buf, const M_hash_dict_t *params)
M_hash_dict_t * M_http_parse_form_data_string(const char *data, M_textcodec_codec_t codec)
M_http_message_type_t
Definition: m_http.h:120
const char * M_http_errcode_to_str(M_http_error_t err)
char * M_http_generate_query_string(const char *uri, const M_hash_dict_t *params)
const char * M_http_code_to_reason(M_uint32 code)
const char * M_http_method_to_str(M_http_method_t method)
@ M_HTTP_DATA_FORMAT_BODY
Definition: m_http.h:154
@ M_HTTP_DATA_FORMAT_CHUNKED
Definition: m_http.h:155
@ M_HTTP_DATA_FORMAT_UNKNOWN
Definition: m_http.h:152
@ M_HTTP_DATA_FORMAT_NONE
Definition: m_http.h:153
@ M_HTTP_DATA_FORMAT_MULTIPART
Definition: m_http.h:156
@ M_HTTP_VERSION_1_1
Definition: m_http.h:131
@ M_HTTP_VERSION_UNKNOWN
Definition: m_http.h:129
@ M_HTTP_VERSION_1_0
Definition: m_http.h:130
@ M_HTTP_ERROR_REQUEST_METHOD
Definition: m_http.h:97
@ M_HTTP_ERROR_STARTLINE_LENGTH
Definition: m_http.h:94
@ M_HTTP_ERROR_CHUNK_EXTENSION_NOTALLOWED
Definition: m_http.h:91
@ M_HTTP_ERROR_CHUNK_STARTLINE_LENGTH
Definition: m_http.h:102
@ M_HTTP_ERROR_SUCCESS_MORE_POSSIBLE
Definition: m_http.h:86
@ M_HTTP_ERROR_TRAILER_NOTALLOWED
Definition: m_http.h:92
@ M_HTTP_ERROR_TEXTCODEC_FAILURE
Definition: m_http.h:114
@ M_HTTP_ERROR_MULTIPART_INVALID
Definition: m_http.h:112
@ M_HTTP_ERROR_CONTENT_LENGTH_MALFORMED
Definition: m_http.h:107
@ M_HTTP_ERROR_MOREDATA
Definition: m_http.h:87
@ M_HTTP_ERROR_URI
Definition: m_http.h:93
@ M_HTTP_ERROR_MULTIPART_MISSING_DATA
Definition: m_http.h:111
@ M_HTTP_ERROR_HEADER_INVALID
Definition: m_http.h:100
@ M_HTTP_ERROR_UNSUPPORTED_DATA
Definition: m_http.h:113
@ M_HTTP_ERROR_NOT_HTTP
Definition: m_http.h:108
@ M_HTTP_ERROR_STOP
Definition: m_http.h:88
@ M_HTTP_ERROR_CHUNK_DATA_MALFORMED
Definition: m_http.h:106
@ M_HTTP_ERROR_STARTLINE_MALFORMED
Definition: m_http.h:95
@ M_HTTP_ERROR_USER_FAILURE
Definition: m_http.h:115
@ M_HTTP_ERROR_MULTIPART_MISSING
Definition: m_http.h:110
@ M_HTTP_ERROR_HEADER_DUPLICATE
Definition: m_http.h:101
@ M_HTTP_ERROR_MULTIPART_NOBOUNDARY
Definition: m_http.h:109
@ M_HTTP_ERROR_HEADER_LENGTH
Definition: m_http.h:98
@ M_HTTP_ERROR_CHUNK_LENGTH
Definition: m_http.h:103
@ M_HTTP_ERROR_UNKNOWN_VERSION
Definition: m_http.h:96
@ M_HTTP_ERROR_CHUNK_EXTENSION
Definition: m_http.h:105
@ M_HTTP_ERROR_CHUNK_MALFORMED
Definition: m_http.h:104
@ M_HTTP_ERROR_SUCCESS
Definition: m_http.h:85
@ M_HTTP_ERROR_INVALIDUSE
Definition: m_http.h:89
@ M_HTTP_ERROR_HEADER_FOLD
Definition: m_http.h:99
@ M_HTTP_ERROR_LENGTH_REQUIRED
Definition: m_http.h:90
@ M_HTTP_METHOD_OPTIONS
Definition: m_http.h:138
@ M_HTTP_METHOD_DELETE
Definition: m_http.h:143
@ M_HTTP_METHOD_CONNECT
Definition: m_http.h:145
@ M_HTTP_METHOD_HEAD
Definition: m_http.h:140
@ M_HTTP_METHOD_UNKNOWN
Definition: m_http.h:137
@ M_HTTP_METHOD_PUT
Definition: m_http.h:142
@ M_HTTP_METHOD_GET
Definition: m_http.h:139
@ M_HTTP_METHOD_PATCH
Definition: m_http.h:146
@ M_HTTP_METHOD_POST
Definition: m_http.h:141
@ M_HTTP_METHOD_TRACE
Definition: m_http.h:144
@ M_HTTP_MESSAGE_TYPE_UNKNOWN
Definition: m_http.h:121
@ M_HTTP_MESSAGE_TYPE_REQUEST
Definition: m_http.h:122
@ M_HTTP_MESSAGE_TYPE_RESPONSE
Definition: m_http.h:123
struct M_list_str M_list_str_t
Definition: m_list_str.h:80
struct M_parser M_parser_t
Definition: m_parser.h:52
M_textcodec_codec_t
Definition: m_textcodec.h:103