GATE
C/C++ Framework
Loading...
Searching...
No Matches
httpclients.h File Reference

HTTP client library. More...

Macros

#define GATE_HTTPCLIENT_FLAG_SECURE   0x0001
#define GATE_HTTPCLIENT_FLAG_DISABLE_VERIFICATION   0x0002
#define GATE_HTTPCLIENT_FLAG_NATIVE_IMPL   0x4000

Functions

GATE_NET_API gate_result_t gate_httpclient_create (gate_httpclient_t *client, gate_string_t const *server, gate_uint16_t port, gate_enumint_t flags)
 Initialize a new HTTP client object.
GATE_NET_API gate_result_t gate_httpclient_send_request (gate_httpclient_t *client, gate_http_request_t *request, gate_http_response_t *response)
 Sends a HTTP request and receives the response from the HTTP server.
GATE_NET_API gate_result_t gate_httpclient_release (gate_httpclient_t *client)
 Releases all resources acquired by the HTTP client object.

Detailed Description

HTTP client library.

Macro Definition Documentation

◆ GATE_HTTPCLIENT_FLAG_SECURE

#define GATE_HTTPCLIENT_FLAG_SECURE   0x0001

enable HTTPS connection

◆ GATE_HTTPCLIENT_FLAG_DISABLE_VERIFICATION

#define GATE_HTTPCLIENT_FLAG_DISABLE_VERIFICATION   0x0002

disable certificate verification

◆ GATE_HTTPCLIENT_FLAG_NATIVE_IMPL

#define GATE_HTTPCLIENT_FLAG_NATIVE_IMPL   0x4000

uses a native TCP socket implementation

Function Documentation

◆ gate_httpclient_create()

GATE_NET_API gate_result_t gate_httpclient_create ( gate_httpclient_t * client,
gate_string_t const * server,
gate_uint16_t port,
gate_enumint_t flags )

Initialize a new HTTP client object.

Parameters
[out]clientPointer to object to be initialized
[in]serverAddress (IP or hostname) of HTTP server to be connected
[in]portServer port to be used for connection
[in]flagscombination of GATE_HTTPCLIENT_FLAG_* values
Returns
GATE_RESULT_* result code

◆ gate_httpclient_send_request()

GATE_NET_API gate_result_t gate_httpclient_send_request ( gate_httpclient_t * client,
gate_http_request_t * request,
gate_http_response_t * response )

Sends a HTTP request and receives the response from the HTTP server.

Parameters
[in]clientPointer to initialized HTTP client object
[in]requestPointer to prepared HTTP request context object
[out]responsePointer to HTTP response object to be initialized with data from the received HTTP response
Returns
GATE_RESULT_* result code

◆ gate_httpclient_release()

GATE_NET_API gate_result_t gate_httpclient_release ( gate_httpclient_t * client)

Releases all resources acquired by the HTTP client object.

Parameters
[in]clientPointer to HTTP client object
Returns
GATE_RESULT_* result code