C library for SOAP (Simple Object Access Protocol)


Client
[nanoHTTP]


Data Structures

struct  httpc_conn

Typedefs

typedef struct httpc_conn httpc_conn_t

Functions

herror_t httpc_init (int argc, char **argv)
void httpc_destroy (void)
httpc_conn_t * httpc_new (void)
void httpc_free (httpc_conn_t *conn)
void httpc_close_free (httpc_conn_t *conn)
int httpc_set_header (httpc_conn_t *conn, const char *key, const char *value)
int httpc_add_header (httpc_conn_t *conn, const char *key, const char *value)
void httpc_add_headers (httpc_conn_t *conn, const hpair_t *values)
int httpc_set_basic_authorization (httpc_conn_t *conn, const char *user, const char *password)
int httpc_set_basic_proxy_authorization (httpc_conn_t *conn, const char *user, const char *password)
herror_t httpc_get (httpc_conn_t *conn, hresponse_t **out, const char *urlstr)
herror_t httpc_post_begin (httpc_conn_t *conn, const char *url)
herror_t httpc_post_end (httpc_conn_t *conn, hresponse_t **out)
herror_t httpc_mime_begin (httpc_conn_t *conn, const char *url, const char *related_start, const char *related_start_info, const char *related_type)
herror_t httpc_mime_next (httpc_conn_t *conn, const char *content_id, const char *content_type, const char *transfer_encoding)
herror_t httpc_mime_end (httpc_conn_t *conn, hresponse_t **out)
herror_t httpc_mime_send_file (httpc_conn_t *conn, const char *content_id, const char *content_type, const char *transfer_encoding, const char *filename)

Detailed Description


Typedef Documentation

typedef struct httpc_conn httpc_conn_t


Function Documentation

int httpc_add_header ( httpc_conn_t *  conn,
const char *  key,
const char *  value 
)

Adds a header element (key, value) pair.

Returns:
0 on success, -1 on failure.
See also:
httpc_set_header

httpc_add_headers

http_general_header_fields

http_request_header_fields

void httpc_add_headers ( httpc_conn_t *  conn,
const hpair_t *  values 
)

Adds a list of (key, value) pairs.

See also:
httpc_set_header

httpc_add_header

http_general_header_fields

http_request_header_fields

void httpc_close_free ( httpc_conn_t *  conn  ) 

Close and release a connection

See also:
httpc_close

httpc_free

void httpc_destroy ( void   ) 

Destroys the nanoHTTP client module.

See also:
httpc_init

void httpc_free ( httpc_conn_t *  conn  ) 

Release a connection (use httpc_close_free() instead)

See also:
httpc_close_free

herror_t httpc_get ( httpc_conn_t *  conn,
hresponse_t **  out,
const char *  urlstr 
)

Invoke a "GET" method request and receive the response

Returns:
H_OK on success
See also:
HTTP_REQUEST_GET

herror_t httpc_init ( int  argc,
char **  argv 
)

Initializes the nanoHTTP client module.

Parameters:
argc Argument count.
argv Argument vector.
Returns:
H_OK on succes or a herror_t struct on failure.
See also:
httpc_destroy

herror_t

herror_t httpc_mime_begin ( httpc_conn_t *  conn,
const char *  url,
const char *  related_start,
const char *  related_start_info,
const char *  related_type 
)

Todo:
move to nanohttp-mime.c merge with httpc_mime_* functions
Begin MIME multipart/related POST request

Returns:
H_OK on success or error flag
See also:
nanohttp_mime_page

herror_t httpc_mime_end ( httpc_conn_t *  conn,
hresponse_t **  out 
)

Finish MIME request and get the response

Returns:
H_OK on success
See also:
nanohttp_mime_page

herror_t httpc_mime_next ( httpc_conn_t *  conn,
const char *  content_id,
const char *  content_type,
const char *  transfer_encoding 
)

Send boundary and part header and continue with next part

Returns:
H_OK on success
See also:
nanohttp_mime_page

herror_t httpc_mime_send_file ( httpc_conn_t *  conn,
const char *  content_id,
const char *  content_type,
const char *  transfer_encoding,
const char *  filename 
)

Send boundary and part header and continue with next part

Returns:
H_OK on success
See also:
nanohttp_mime_page

httpc_conn_t* httpc_new ( void   ) 

Creates a new HTTP client connection object. You need to create at least one HTTP client connection to communicate via HTTP.

Returns:
A pointer to a httpc_conn_t structure on success, NULL on error.
See also:
httpc_conn_t

herror_t httpc_post_begin ( httpc_conn_t *  conn,
const char *  url 
)

Start a "POST" method request

Returns:
H_OK on success or error flag
See also:
HTTP_REQUEST_POST

httpc_post_end

herror_t httpc_post_end ( httpc_conn_t *  conn,
hresponse_t **  out 
)

End a "POST" method and receive the response. You MUST call httpc_post_end() before!

Returns:
H_OK on success
See also:
httpc_post_begin

HTTP_REQUEST_POST

int httpc_set_basic_authorization ( httpc_conn_t *  conn,
const char *  user,
const char *  password 
)

Sets a HEADER_AUTHORIZATION header.

Parameters:
conn The HTTP connection.
user The username.
password The password.
See also:
httpc_set_header

HEADER_AUTHORIZATION

int httpc_set_basic_proxy_authorization ( httpc_conn_t *  conn,
const char *  user,
const char *  password 
)

Sets a HEADER_PROXY_AUTHORIZATION header.

Parameters:
conn The HTTP connection.
user The username.
password The password.
See also:
httpc_set_header

HEADER_PROXY_AUTHORIZATION

int httpc_set_header ( httpc_conn_t *  conn,
const char *  key,
const char *  value 
)

Sets header element (key,value) pair.

Returns:
0 on success or failure (yeah!), 1 if a (key,value) pair was replaced.
See also:
httpc_add_header

httpc_add_headers

http_general_header_fields

http_request_header_fields


csoap project homepage: http://csoap.sourceforge.net