Top |
raptor_www * | raptor_new_www () |
raptor_www * | raptor_new_www_with_connection () |
void | raptor_free_www () |
void | (*raptor_www_write_bytes_handler) () |
void | (*raptor_www_content_type_handler) () |
int | raptor_www_set_user_agent2 () |
void | raptor_www_set_user_agent () |
int | raptor_www_set_proxy2 () |
void | raptor_www_set_proxy () |
int | raptor_www_set_http_accept2 () |
void | raptor_www_set_http_accept () |
int | raptor_www_set_http_cache_control () |
void | raptor_www_set_write_bytes_handler () |
void | raptor_www_set_connection_timeout () |
void | raptor_www_set_content_type_handler () |
int | (*raptor_uri_filter_func) () |
void | raptor_www_set_uri_filter () |
void | (*raptor_www_final_uri_handler) () |
raptor_uri * | raptor_www_get_final_uri () |
void | raptor_www_set_final_uri_handler () |
int | raptor_www_fetch () |
int | raptor_www_fetch_to_string () |
void * | raptor_www_get_connection () |
int | raptor_www_set_ssl_cert_options () |
int | raptor_www_set_ssl_verify_options () |
void | raptor_www_abort () |
raptor_www *
raptor_new_www (raptor_world *world
);
Constructor - create a new raptor_www object.
raptor_www * raptor_new_www_with_connection (raptor_world *world
,void *connection
);
Constructor - create a new raptor_www object over an existing WWW connection.
At present this only works with a libcurl CURL handle object
when raptor is compiled with libcurl suppport. Otherwise the
connection
is ignored. This allows such things as setting
up special flags on the curl handle before passing into the constructor.
void
raptor_free_www (raptor_www *www
);
Destructor - destroy a raptor_www object.
void (*raptor_www_write_bytes_handler) (raptor_www *www
,void *userdata
,const void *ptr
,size_t size
,size_t nmemb
);
Receiving bytes of data from WWW retrieval handler.
void (*raptor_www_content_type_handler) (raptor_www *www
,void *userdata
,const char *content_type
);
Receiving Content-Type: header from WWW retrieval handler.
int raptor_www_set_user_agent2 (raptor_www *www
,const char *user_agent
,size_t user_agent_len
);
Set the user agent value, for HTTP requests typically.
void raptor_www_set_user_agent (raptor_www *www
,const char *user_agent
);
raptor_www_set_user_agent
is deprecated and should not be used in newly-written code.
Set the user agent value, for HTTP requests typically.
Deprecated
: use raptor_www_set_user_agent2()
which takes a length
parameter and returns a value to singify failure.
int raptor_www_set_proxy2 (raptor_www *www
,const char *proxy
,size_t proxy_len
);
Set the proxy for the WWW object.
The proxy
usually a string of the form http://server.domain:port.
void raptor_www_set_proxy (raptor_www *www
,const char *proxy
);
raptor_www_set_proxy
is deprecated and should not be used in newly-written code.
Set the proxy for the WWW object.
The proxy
usually a string of the form http://server.domain:port.
Deprecated
: use raptor_www_set_proxy2()
which takes an length
parameter and returns a value to singify failure.
int raptor_www_set_http_accept2 (raptor_www *www
,const char *value
,size_t value_len
);
Set HTTP Accept header.
www |
raptor_www class |
|
value |
Accept: header value or NULL to have an empty one. |
|
value_len |
Length of |
void raptor_www_set_http_accept (raptor_www *www
,const char *value
);
raptor_www_set_http_accept
is deprecated and should not be used in newly-written code.
Set HTTP Accept header.
Deprecated
: use raptor_www_set_http_accept2()
which takes an
length parameter and returns a value to singify failure.
int raptor_www_set_http_cache_control (raptor_www *www
,const char *cache_control
);
Set HTTP Cache-Control:header (default none)
The cache_control
value can be a string to set it, "" to send
a blank header or NULL to not set the header at all.
void raptor_www_set_write_bytes_handler (raptor_www *www
,raptor_www_write_bytes_handler handler
,void *user_data
);
Set the handler to receive bytes written by the raptor_www implementation.
void raptor_www_set_connection_timeout (raptor_www *www
,int timeout
);
Set WWW connection timeout
void raptor_www_set_content_type_handler (raptor_www *www
,raptor_www_content_type_handler handler
,void *user_data
);
Set the handler to receive the HTTP Content-Type header value.
This is called if or when the value is discovered during retrieval by the raptor_www implementation. Not all implementations provide access to this.
int (*raptor_uri_filter_func) (void *user_data
,raptor_uri *uri
);
Callback function for raptor_www_set_uri_filter
void raptor_www_set_uri_filter (raptor_www *www
,raptor_uri_filter_func filter
,void *user_data
);
Set URI filter function for WWW retrieval.
void (*raptor_www_final_uri_handler) (raptor_www *www
,void *userdata
,raptor_uri *final_uri
);
Receiving the final resolved URI from a WWW retrieval
raptor_uri *
raptor_www_get_final_uri (raptor_www *www
);
Get the WWW final resolved URI.
This returns the URI used after any protocol redirection.
void raptor_www_set_final_uri_handler (raptor_www *www
,raptor_www_final_uri_handler handler
,void *user_data
);
Set the handler to receive the HTTP Content-Type header value.
This is called if or when the value is discovered during retrieval by the raptor_www implementation. Not all implementations provide access to this.
int raptor_www_fetch (raptor_www *www
,raptor_uri *uri
);
Start a WWW content retrieval for the given URI, returning data via the write_bytes handler.
int raptor_www_fetch_to_string (raptor_www *www
,raptor_uri *uri
,void **string_p
,size_t *length_p
,raptor_data_malloc_handler const malloc_handler
);
Start a WWW content retrieval for the given URI, returning the data in a new string.
If malloc_handler
is null, raptor will allocate it using it's
own memory allocator. *string_p is set to NULL on failure (and
*length_p to 0 if length_p is not NULL).
void *
raptor_www_get_connection (raptor_www *www
);
Get WWW library connection object.
Return the internal WWW connection handle. For libcurl, this returns the CURL handle and for libxml the context. Otherwise it returns NULL.
int raptor_www_set_ssl_cert_options (raptor_www *www
,const char *cert_filename
,const char *cert_type
,const char *cert_passphrase
);
Set SSL client certificate options (where supported)
int raptor_www_set_ssl_verify_options (raptor_www *www
,int verify_peer
,int verify_host
);
Set whether SSL verifies the authenticity of the peer's certificate
These options correspond to setting the curl CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options.
void raptor_www_abort (raptor_www *www
,const char *reason
);
Abort an ongoing raptor WWW operation and pass back a reason.
This is typically used within one of the raptor WWW handlers when retrieval need no longer continue due to another processing issue or error.