BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB-UTIL Reference

pj_http_req_param Struct Reference
[Simple HTTP Client]

Data Structures

struct  pj_http_reqdata

Data Fields

int addr_family
pj_str_t method
pj_str_t version
pj_time_val timeout
void * user_data
pj_http_headers headers
struct
pj_http_req_param::pj_http_reqdata 
reqdata
pj_http_auth_cred auth_cred
pj_uint16_t source_port_range_start
pj_uint16_t source_port_range_size
pj_uint16_t max_retries

Detailed Description

Parameters that can be given during http request creation. Application must initialize this structure with pj_http_req_param_default().


Field Documentation

The address family of the URL. Default is pj_AF_INET().

Authentication credential needed to respond to 401/407 response.

HTTP request headers. Default is empty.

Max number of retries if binding to a port fails. Note that this does not adress the scenario where a request times out or errors. This needs to be taken care of by the on_complete callback.

Default is 3

The HTTP request method. Default is GET.

This structure describes the http request body. If application specifies the data to send, the data must remain valid until the HTTP request is sent. Alternatively, application can choose to specify total_size as the total data size to send instead while leaving the data NULL (and its size 0). In this case, HTTP request will then call on_send_data() callback once it is ready to send the request body. This will be useful if application does not wish to load the data into the buffer at once.

Default is empty.

Optional source port range to use when binding. The size of the port restriction range

Default is 0 (The OS will select the source port automatically))

Optional source port range to use when binding the socket. This can be used if the source port needs to be within a certain range for instance due to strict firewall settings. The port used will be randomized within the range.

Note that if authentication is configured, the authentication response will be a new transaction

Default is 0 (The OS will select the source port automatically)

HTTP request operation timeout. Default is PJ_HTTP_DEFAULT_TIMEOUT.

User-defined data. Default is NULL.

The HTTP protocol version ("1.0" or "1.1"). Default is "1.0".


The documentation for this struct was generated from the following file:

 


PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.