Soletta™ Framework
|
HTTP Client sample. More...
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include "soletta.h"
#include "sol-http.h"
#include "sol-http-client.h"
Macros | |
#define | CREATE_PARAM(_key, _filename, _value) |
Functions | |
static int | create_header_params (struct sol_http_params *params, const char *value) |
static int | create_post_data_params (struct sol_http_params *params, const char *query) |
static int | create_post_field_params (struct sol_http_params *params, const char *value) |
static void | response_cb (void *userdata, struct sol_http_client_connection *connection, struct sol_http_response *response) |
static void | shutdown (void) |
SOL_MAIN_DEFAULT (startup, shutdown) | |
static void | startup (void) |
Variables | |
static bool | verbose = false |
HTTP Client sample.
A command-line application that allows one make GET and POST. It intends to replicate some curl functionalities, such as, set post fields and headers.
#define CREATE_PARAM | ( | _key, | |
_filename, | |||
_value | |||
) |
Referenced by create_post_data_params().
|
static |
References sol_str_slice::data, key, sol_str_slice::len, SOL_HTTP_PARAM_HEADER, sol_http_params_add_copy(), SOL_STR_SLICE_PRINT, sol_http_param_value::type, value, and sol_http_param_value::value.
Referenced by startup().
|
static |
References CREATE_PARAM, sol_str_slice::data, sol_str_slice::len, sol_http_params_add_copy(), SOL_STR_SLICE_EMPTY, sol_str_slice_from_str(), SOL_STR_SLICE_PRINT, sol_str_slice_split(), sol_vector_clear(), and SOL_VECTOR_FOREACH_IDX.
Referenced by startup().
|
static |
References sol_http_split_post_field().
Referenced by startup().
|
static |
References sol_http_response::content, sol_buffer::data, sol_http_response::param, sol_http_response::response_code, SOL_HTTP_PARAM_COOKIE, SOL_HTTP_PARAM_HEADER, SOL_HTTP_PARAMS_FOREACH_IDX, SOL_HTTP_STATUS_OK, sol_quit_with_code(), SOL_STR_SLICE_PRINT, sol_http_param_value::type, sol_buffer::used, value, sol_http_param_value::value, and verbose.
Referenced by startup().
|
static |
|
static |
|
static |
Referenced by response_cb(), and startup().