Synchronous HTTP client.
More...
#include "compile_time.h"
#include "src/lib/http_client.h"
#include "dist/mongoose/mongoose.h"
#include "src/lib/filehandler.h"
#include "src/lib/log.h"
#include "src/lib/sds_extras.h"
#include <errno.h>
#include <inttypes.h>
◆ get_dnsserver()
| sds get_dnsserver |
( |
void |
| ) |
|
Public functions Reads the dns server from resolv.conf
- Returns
- newly allocated sds string with first nameserver
◆ http_client_ev_handler()
| static void http_client_ev_handler |
( |
struct mg_connection * |
nc, |
|
|
int |
ev, |
|
|
void * |
ev_data |
|
) |
| |
|
static |
Private definitions
Private functions Event handler for the http request made by http_client_request
- Parameters
-
| nc | mongoose network connection |
| ev | event id |
| ev_data | event data (http response) |
◆ http_client_get_content_type()
Returns a sds pointer to the content-type header from response
- Parameters
-
- Returns
- sds or NULL if not found
◆ http_client_request()
Sends a HTTP request and follows redirects.
- Parameters
-
◆ http_client_response_clear()
Clears a http response struct for the HTTP client
- Parameters
-
| mg_client_response | pointer to mg_client response struct |
◆ http_client_response_init()
Initializes a http response struct for the HTTP client
- Parameters
-
| mg_client_response | pointer to mg_client response struct |