Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
client.c File Reference

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
 

Detailed Description

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.

Macro Definition Documentation

#define CREATE_PARAM (   _key,
  _filename,
  _value 
)
Value:
.value.data.filename = _filename, \
.value.data.key = _key, \
.value.data.value = _value \
}
Definition: sol-http.h:109
Used to define an HTTP parameter.
Definition: sol-http.h:215
Examples:
/src/samples/http/client.c.

Referenced by create_post_data_params().

Function Documentation

static int create_header_params ( struct sol_http_params params,
const char *  value 
)
static
static int create_post_data_params ( struct sol_http_params params,
const char *  query 
)
static
static int create_post_field_params ( struct sol_http_params params,
const char *  value 
)
static
Examples:
/src/samples/http/client.c.

References sol_http_split_post_field().

Referenced by startup().

static void response_cb ( void *  userdata,
struct sol_http_client_connection connection,
struct sol_http_response response 
)
static
static void shutdown ( void  )
static
SOL_MAIN_DEFAULT ( startup  ,
shutdown   
)
static void startup ( void  )
static

Variable Documentation

bool verbose = false
static
Examples:
/src/samples/http/client.c.

Referenced by response_cb(), and startup().