GATE
httptypes.h File Reference

Generic HTTP types and field values. More...

#include "gate/net/gate_net_api.h"
#include "gate/strings.h"
#include "gate/streams.h"
#include "gate/maps.h"
#include "gate/arrays.h"

Classes

struct  gate_http_request_class
 
struct  gate_http_response_class
 

Macros

#define GATE_HTTP_DEFAULT_HTTP_PORT   80
 
#define GATE_HTTP_DEFAULT_HTTPS_PORT   443
 
#define GATE_HTTP_METHOD_HEAD   "HEAD"
 
#define GATE_HTTP_METHOD_GET   "GET"
 
#define GATE_HTTP_METHOD_POST   "POST"
 
#define GATE_HTTP_METHOD_PUT   "PUT"
 
#define GATE_HTTP_METHOD_DELETE   "DELETE"
 
#define GATE_HTTP_METHOD_OPTION   "OPTION"
 
#define GATE_HTTP_HEADER_STATUS   "Status"
 
#define GATE_HTTP_HEADER_CONTENTLENGTH   "Content-Length"
 
#define GATE_HTTP_HEADER_CONTENTTYPE   "Content-Type"
 
#define GATE_HTTP_HEADER_CONTENTENCODING   "Content-Encoding"
 
#define GATE_HTTP_HEADER_ACCEPTENCODING   "Accept-Encoding"
 
#define GATE_HTTP_HEADER_SERVER   "Server"
 
#define GATE_HTTP_HEADER_CONNECTION   "Connection"
 
#define GATE_HTTP_HEADER_HOST   "Host"
 
#define GATE_HTTP_HEADER_DATE   "Date"
 
#define GATE_HTTP_HEADER_CONTENTDISPOSITION   "Content-Disposition"
 
#define GATE_HTTP_HEADER_AUTHORIZATION   "Authorization"
 
#define GATE_HTTP_HEADER_LOCATION   "Location"
 
#define GATE_HTTP_HEADER_COOKIE   "Cookie"
 
#define GATE_HTTP_HEADER_USERAGENT   "User-Agent"
 
#define GATE_HTTP_HEADER_UPGRADE   "Upgrade"
 
#define GATE_HTTP_HEADER_REFERER   "Referer"
 
#define GATE_HTTP_HEADER_ORIGIN   "Origin"
 
#define GATE_HTTP_HEADERVALUE_CONNECTION_CLOSE   "close"
 
#define GATE_HTTP_HEADERVALUE_CONNECTION_KEEPALIVE   "keep-alive"
 
#define GATE_HTTP_HEADERVALUE_CONNECTION_UPGRADE   "upgrade"
 
#define GATE_HTTP_HEADERVALUE_UPGRADE_WEBSOCKET   "websocket"
 
#define GATE_HTTP_HEADERVALUE_CONTENTTYPE_URLENCODED   "application/x-www-form-urlencoded"
 
#define GATE_HTTP_HEADERVALUE_CONTENTTYPE_MULTIPARTFORMDATA   "multipart/form-data"
 
#define GATE_HTTP_HEADERVALUE_CONTENTTYPE_OCTETSTREAM   "application/octet-stream"
 

Typedefs

typedef struct gate_http_request_class gate_http_request_t
 
typedef struct gate_http_response_class gate_http_response_t
 

Functions

GATE_NET_API gate_result_t gate_http_request_init (gate_http_request_t *request, gate_string_t const *method, gate_string_t const *path)
 
GATE_NET_API gate_result_t gate_http_request_init_str (gate_http_request_t *request, char const *method, char const *path)
 
GATE_NET_API gate_result_t gate_http_request_copy (gate_http_request_t *request, gate_http_request_t const *src)
 
GATE_NET_API gate_result_t gate_http_request_release (gate_http_request_t *request)
 
GATE_NET_API gate_result_t gate_http_response_init (gate_http_response_t *response)
 
GATE_NET_API gate_result_t gate_http_response_copy (gate_http_response_t *response, gate_http_response_t const *src)
 
GATE_NET_API gate_result_t gate_http_response_release (gate_http_response_t *response)
 
GATE_NET_API char const * gate_http_response_status_text (gate_uint32_t status_code)
 
GATE_NET_API gate_result_t gate_http_parse_urlencoded_content (gate_string_t const *content, gate_flatmap_t *append_to_stringmap)
 
GATE_NET_API gate_result_t gate_http_build_urlencoded_content (gate_flatmap_t const *stringmap, gate_strbuilder_t *append_to_builder)
 
GATE_NET_API gate_result_t gate_http_resolve_mime_type (gate_string_t const *file_ext, gate_string_t *mine_type)
 
GATE_NET_API char const * gate_http_resolve_mime_type_str (char const *file_ext)
 

Detailed Description

Generic HTTP types and field values.