/usr/share/doc/libxml2-devel/html
NameSizeModeActions
book1.html96350644editdlrm
home.png6540644editdlrm
index.html96350644editdlrm
left.png4590644editdlrm
libxml-c14n.html180560644editdlrm
libxml-catalog.html410210644editdlrm
libxml-chvalid.html184230644editdlrm
libxml-debugXML.html379110644editdlrm
libxml-dict.html179450644editdlrm
libxml-DOCBparser.html206250644editdlrm
libxml-encoding.html350320644editdlrm
libxml-entities.html276890644editdlrm
libxml-globals.html330880644editdlrm
libxml-hash.html473760644editdlrm
libxml-HTMLparser.html600720644editdlrm
libxml-HTMLtree.html286380644editdlrm
libxml-lib.html96350644editdlrm
libxml-list.html300730644editdlrm
libxml-nanoftp.html270900644editdlrm
libxml-nanohttp.html212240644editdlrm
libxml-parser.html1467670644editdlrm
libxml-parserInternals.html1225140644editdlrm
libxml-pattern.html236730644editdlrm
libxml-relaxng.html410020644editdlrm
libxml-SAX.html434820644editdlrm
libxml-SAX2.html444490644editdlrm
libxml-schemasInternals.html640400644editdlrm
libxml-schematron.html217320644editdlrm
libxml-threads.html171610644editdlrm
libxml-tree.html2356560644editdlrm
libxml-uri.html226780644editdlrm
libxml-valid.html1024590644editdlrm
libxml-xinclude.html197050644editdlrm
libxml-xlink.html216460644editdlrm
libxml-xmlautomata.html395740644editdlrm
libxml-xmlerror.html1097020644editdlrm
libxml-xmlexports.html78550644editdlrm
libxml-xmlIO.html639630644editdlrm
libxml-xmlmemory.html292270644editdlrm
libxml-xmlmodule.html117130644editdlrm
libxml-xmlreader.html1142270644editdlrm
libxml-xmlregexp.html457810644editdlrm
libxml-xmlsave.html192490644editdlrm
libxml-xmlschemas.html477710644editdlrm
libxml-xmlschemastypes.html493760644editdlrm
libxml-xmlstring.html391580644editdlrm
libxml-xmlunicode.html1128520644editdlrm
libxml-xmlversion.html206290644editdlrm
libxml-xmlwriter.html1174800644editdlrm
libxml-xpath.html650420644editdlrm
libxml-xpathInternals.html1432220644editdlrm
libxml-xpointer.html299750644editdlrm
right.png4720644editdlrm
up.png4060644editdlrm
Edit: /usr/share/doc/libxml2-devel/html/libxml-nanohttp.html (21224B)
Module nanohttp from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module nanohttp from libxml2

API Menu
API Indexes
Related links

minimal HTTP implementation allowing to fetch resources like external subset.

Table of Contents

const char *	xmlNanoHTTPAuthHeader	(void * ctx)
void	xmlNanoHTTPCleanup		(void)
void	xmlNanoHTTPClose		(void * ctx)
int	xmlNanoHTTPContentLength	(void * ctx)
const char *	xmlNanoHTTPEncoding	(void * ctx)
int	xmlNanoHTTPFetch		(const char * URL, 
const char * filename,
char ** contentType)
void	xmlNanoHTTPInit			(void)
void *	xmlNanoHTTPMethod		(const char * URL, 
const char * method,
const char * input,
char ** contentType,
const char * headers,
int ilen)
void *	xmlNanoHTTPMethodRedir		(const char * URL, 
const char * method,
const char * input,
char ** contentType,
char ** redir,
const char * headers,
int ilen)
const char *	xmlNanoHTTPMimeType	(void * ctx)
void *	xmlNanoHTTPOpen			(const char * URL, 
char ** contentType)
void *	xmlNanoHTTPOpenRedir		(const char * URL, 
char ** contentType,
char ** redir)
int	xmlNanoHTTPRead			(void * ctx, 
void * dest,
int len)
const char *	xmlNanoHTTPRedir	(void * ctx)
int	xmlNanoHTTPReturnCode		(void * ctx)
int	xmlNanoHTTPSave			(void * ctxt, 
const char * filename)
void	xmlNanoHTTPScanProxy		(const char * URL)

Description

Function: xmlNanoHTTPAuthHeader

const char *	xmlNanoHTTPAuthHeader	(void * ctx)

Get the authentication header of an HTTP context

ctx:the HTTP context
Returns:the stashed value of the WWW-Authenticate or Proxy-Authenticate header.

Function: xmlNanoHTTPCleanup

void	xmlNanoHTTPCleanup		(void)

Cleanup the HTTP protocol layer.

Function: xmlNanoHTTPClose

void	xmlNanoHTTPClose		(void * ctx)

This function closes an HTTP context, it ends up the connection and free all data related to it.

ctx:the HTTP context

Function: xmlNanoHTTPContentLength

int	xmlNanoHTTPContentLength	(void * ctx)

Provides the specified content length from the HTTP header.

ctx:the HTTP context
Returns:the specified content length from the HTTP header. Note that a value of -1 indicates that the content length element was not included in the response header.

Function: xmlNanoHTTPEncoding

const char *	xmlNanoHTTPEncoding	(void * ctx)

Provides the specified encoding if specified in the HTTP headers.

ctx:the HTTP context
Returns:the specified encoding or NULL if not available

Function: xmlNanoHTTPFetch

int	xmlNanoHTTPFetch		(const char * URL, 
const char * filename,
char ** contentType)

This function try to fetch the indicated resource via HTTP GET and save it's content in the file.

URL:The URL to load
filename:the filename where the content should be saved
contentType:if available the Content-Type information will be returned at that location
Returns:-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller

Function: xmlNanoHTTPInit

void	xmlNanoHTTPInit			(void)

Initialize the HTTP protocol layer. Currently it just checks for proxy information

Function: xmlNanoHTTPMethod

void *	xmlNanoHTTPMethod		(const char * URL, 
const char * method,
const char * input,
char ** contentType,
const char * headers,
int ilen)

This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.

URL:The URL to load
method:the HTTP method to use
input:the input string if any
contentType:the Content-Type information IN and OUT
headers:the extra headers
ilen:input length
Returns:NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller

Function: xmlNanoHTTPMethodRedir

void *	xmlNanoHTTPMethodRedir		(const char * URL, 
const char * method,
const char * input,
char ** contentType,
char ** redir,
const char * headers,
int ilen)

This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.

URL:The URL to load
method:the HTTP method to use
input:the input string if any
contentType:the Content-Type information IN and OUT
redir:the redirected URL OUT
headers:the extra headers
ilen:input length
Returns:NULL in case of failure, otherwise a request handler. The contentType, or redir, if provided must be freed by the caller

Function: xmlNanoHTTPMimeType

const char *	xmlNanoHTTPMimeType	(void * ctx)

Provides the specified Mime-Type if specified in the HTTP headers.

ctx:the HTTP context
Returns:the specified Mime-Type or NULL if not available

Function: xmlNanoHTTPOpen

void *	xmlNanoHTTPOpen			(const char * URL, 
char ** contentType)

This function try to open a connection to the indicated resource via HTTP GET.

URL:The URL to load
contentType:if available the Content-Type information will be returned at that location
Returns:NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller

Function: xmlNanoHTTPOpenRedir

void *	xmlNanoHTTPOpenRedir		(const char * URL, 
char ** contentType,
char ** redir)

This function try to open a connection to the indicated resource via HTTP GET.

URL:The URL to load
contentType:if available the Content-Type information will be returned at that location
redir:if available the redirected URL will be returned
Returns:NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller

Function: xmlNanoHTTPRead

int	xmlNanoHTTPRead			(void * ctx, 
void * dest,
int len)

This function tries to read @len bytes from the existing HTTP connection and saves them in @dest. This is a blocking call.

ctx:the HTTP context
dest:a buffer
len:the buffer length
Returns:the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.

Function: xmlNanoHTTPRedir

const char *	xmlNanoHTTPRedir	(void * ctx)

Provides the specified redirection URL if available from the HTTP header.

ctx:the HTTP context
Returns:the specified redirection URL or NULL if not redirected.

Function: xmlNanoHTTPReturnCode

int	xmlNanoHTTPReturnCode		(void * ctx)

Get the latest HTTP return code received

ctx:the HTTP context
Returns:the HTTP return code for the request.

Function: xmlNanoHTTPSave

int	xmlNanoHTTPSave			(void * ctxt, 
const char * filename)

This function saves the output of the HTTP transaction to a file It closes and free the context at the end

ctxt:the HTTP context
filename:the filename where the content should be saved
Returns:-1 in case of failure, 0 in case of success.

Function: xmlNanoHTTPScanProxy

void	xmlNanoHTTPScanProxy		(const char * URL)

(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.

URL:The proxy URL used to initialize the proxy context

Daniel Veillard