1*7c568831SAndroid Build Coastguard Worker<html> 2*7c568831SAndroid Build Coastguard Worker<head> 3*7c568831SAndroid Build Coastguard Worker<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4*7c568831SAndroid Build Coastguard Worker<title>nanohttp: minimal HTTP implementation</title> 5*7c568831SAndroid Build Coastguard Worker<meta name="generator" content="Libxml2 devhelp stylesheet"> 6*7c568831SAndroid Build Coastguard Worker<link rel="start" href="index.html" title="libxml2 Reference Manual"> 7*7c568831SAndroid Build Coastguard Worker<link rel="up" href="general.html" title="API"> 8*7c568831SAndroid Build Coastguard Worker<link rel="stylesheet" href="style.css" type="text/css"> 9*7c568831SAndroid Build Coastguard Worker<link rel="chapter" href="general.html" title="API"> 10*7c568831SAndroid Build Coastguard Worker</head> 11*7c568831SAndroid Build Coastguard Worker<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 12*7c568831SAndroid Build Coastguard Worker<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"> 13*7c568831SAndroid Build Coastguard Worker<td><a accesskey="p" href="libxml2-nanoftp.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> 14*7c568831SAndroid Build Coastguard Worker<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> 15*7c568831SAndroid Build Coastguard Worker<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> 16*7c568831SAndroid Build Coastguard Worker<td><a accesskey="n" href="libxml2-parser.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> 17*7c568831SAndroid Build Coastguard Worker<th width="100%" align="center">libxml2 Reference Manual</th> 18*7c568831SAndroid Build Coastguard Worker</tr></table> 19*7c568831SAndroid Build Coastguard Worker<h2><span class="refentrytitle">nanohttp</span></h2> 20*7c568831SAndroid Build Coastguard Worker<p>nanohttp - minimal HTTP implementation</p> 21*7c568831SAndroid Build Coastguard Worker<p>minimal HTTP implementation allowing to fetch resources like external subset. </p> 22*7c568831SAndroid Build Coastguard Worker<p>Author(s): Daniel Veillard </p> 23*7c568831SAndroid Build Coastguard Worker<div class="refsynopsisdiv"> 24*7c568831SAndroid Build Coastguard Worker<h2>Synopsis</h2> 25*7c568831SAndroid Build Coastguard Worker<pre class="synopsis">const char * <a href="#xmlNanoHTTPAuthHeader">xmlNanoHTTPAuthHeader</a> (void * ctx); 26*7c568831SAndroid Build Coastguard Workervoid <a href="#xmlNanoHTTPCleanup">xmlNanoHTTPCleanup</a> (void); 27*7c568831SAndroid Build Coastguard Workervoid <a href="#xmlNanoHTTPClose">xmlNanoHTTPClose</a> (void * ctx); 28*7c568831SAndroid Build Coastguard Workerint <a href="#xmlNanoHTTPContentLength">xmlNanoHTTPContentLength</a> (void * ctx); 29*7c568831SAndroid Build Coastguard Workerconst char * <a href="#xmlNanoHTTPEncoding">xmlNanoHTTPEncoding</a> (void * ctx); 30*7c568831SAndroid Build Coastguard Workerint <a href="#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a> (const char * URL, <br> const char * filename, <br> char ** contentType); 31*7c568831SAndroid Build Coastguard Workervoid <a href="#xmlNanoHTTPInit">xmlNanoHTTPInit</a> (void); 32*7c568831SAndroid Build Coastguard Workervoid * <a href="#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a> (const char * URL, <br> const char * method, <br> const char * input, <br> char ** contentType, <br> const char * headers, <br> int ilen); 33*7c568831SAndroid Build Coastguard Workervoid * <a href="#xmlNanoHTTPMethodRedir">xmlNanoHTTPMethodRedir</a> (const char * URL, <br> const char * method, <br> const char * input, <br> char ** contentType, <br> char ** redir, <br> const char * headers, <br> int ilen); 34*7c568831SAndroid Build Coastguard Workerconst char * <a href="#xmlNanoHTTPMimeType">xmlNanoHTTPMimeType</a> (void * ctx); 35*7c568831SAndroid Build Coastguard Workervoid * <a href="#xmlNanoHTTPOpen">xmlNanoHTTPOpen</a> (const char * URL, <br> char ** contentType); 36*7c568831SAndroid Build Coastguard Workervoid * <a href="#xmlNanoHTTPOpenRedir">xmlNanoHTTPOpenRedir</a> (const char * URL, <br> char ** contentType, <br> char ** redir); 37*7c568831SAndroid Build Coastguard Workerint <a href="#xmlNanoHTTPRead">xmlNanoHTTPRead</a> (void * ctx, <br> void * dest, <br> int len); 38*7c568831SAndroid Build Coastguard Workerconst char * <a href="#xmlNanoHTTPRedir">xmlNanoHTTPRedir</a> (void * ctx); 39*7c568831SAndroid Build Coastguard Workerint <a href="#xmlNanoHTTPReturnCode">xmlNanoHTTPReturnCode</a> (void * ctx); 40*7c568831SAndroid Build Coastguard Workerint <a href="#xmlNanoHTTPSave">xmlNanoHTTPSave</a> (void * ctxt, <br> const char * filename); 41*7c568831SAndroid Build Coastguard Workervoid <a href="#xmlNanoHTTPScanProxy">xmlNanoHTTPScanProxy</a> (const char * URL); 42*7c568831SAndroid Build Coastguard Worker</pre> 43*7c568831SAndroid Build Coastguard Worker</div> 44*7c568831SAndroid Build Coastguard Worker<div class="refsect1" lang="en"><h2>Description</h2></div> 45*7c568831SAndroid Build Coastguard Worker<div class="refsect1" lang="en"> 46*7c568831SAndroid Build Coastguard Worker<h2>Details</h2> 47*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 48*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 49*7c568831SAndroid Build Coastguard Worker<h3> 50*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPAuthHeader"></a>xmlNanoHTTPAuthHeader ()</h3> 51*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">const char * xmlNanoHTTPAuthHeader (void * ctx)<br> 52*7c568831SAndroid Build Coastguard Worker</pre> 53*7c568831SAndroid Build Coastguard Worker<p>Get the authentication header of an HTTP context</p> 54*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 55*7c568831SAndroid Build Coastguard Worker<col align="left"> 56*7c568831SAndroid Build Coastguard Worker<tbody> 57*7c568831SAndroid Build Coastguard Worker<tr> 58*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 59*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 60*7c568831SAndroid Build Coastguard Worker</tr> 61*7c568831SAndroid Build Coastguard Worker<tr> 62*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 63*7c568831SAndroid Build Coastguard Worker<td>the stashed value of the WWW-Authenticate or Proxy-Authenticate header.</td> 64*7c568831SAndroid Build Coastguard Worker</tr> 65*7c568831SAndroid Build Coastguard Worker</tbody> 66*7c568831SAndroid Build Coastguard Worker</table></div> 67*7c568831SAndroid Build Coastguard Worker</div> 68*7c568831SAndroid Build Coastguard Worker<hr> 69*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 70*7c568831SAndroid Build Coastguard Worker<h3> 71*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPCleanup"></a>xmlNanoHTTPCleanup ()</h3> 72*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void xmlNanoHTTPCleanup (void)<br> 73*7c568831SAndroid Build Coastguard Worker</pre> 74*7c568831SAndroid Build Coastguard Worker<p>Cleanup the HTTP protocol layer.</p> 75*7c568831SAndroid Build Coastguard Worker</div> 76*7c568831SAndroid Build Coastguard Worker<hr> 77*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 78*7c568831SAndroid Build Coastguard Worker<h3> 79*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPClose"></a>xmlNanoHTTPClose ()</h3> 80*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void xmlNanoHTTPClose (void * ctx)<br> 81*7c568831SAndroid Build Coastguard Worker</pre> 82*7c568831SAndroid Build Coastguard Worker<p>This function closes an HTTP context, it ends up the connection and free all data related to it.</p> 83*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 84*7c568831SAndroid Build Coastguard Worker<col align="left"> 85*7c568831SAndroid Build Coastguard Worker<tbody><tr> 86*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 87*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 88*7c568831SAndroid Build Coastguard Worker</tr></tbody> 89*7c568831SAndroid Build Coastguard Worker</table></div> 90*7c568831SAndroid Build Coastguard Worker</div> 91*7c568831SAndroid Build Coastguard Worker<hr> 92*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 93*7c568831SAndroid Build Coastguard Worker<h3> 94*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPContentLength"></a>xmlNanoHTTPContentLength ()</h3> 95*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">int xmlNanoHTTPContentLength (void * ctx)<br> 96*7c568831SAndroid Build Coastguard Worker</pre> 97*7c568831SAndroid Build Coastguard Worker<p>Provides the specified content length from the HTTP header.</p> 98*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 99*7c568831SAndroid Build Coastguard Worker<col align="left"> 100*7c568831SAndroid Build Coastguard Worker<tbody> 101*7c568831SAndroid Build Coastguard Worker<tr> 102*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 103*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 104*7c568831SAndroid Build Coastguard Worker</tr> 105*7c568831SAndroid Build Coastguard Worker<tr> 106*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 107*7c568831SAndroid Build Coastguard Worker<td>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.</td> 108*7c568831SAndroid Build Coastguard Worker</tr> 109*7c568831SAndroid Build Coastguard Worker</tbody> 110*7c568831SAndroid Build Coastguard Worker</table></div> 111*7c568831SAndroid Build Coastguard Worker</div> 112*7c568831SAndroid Build Coastguard Worker<hr> 113*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 114*7c568831SAndroid Build Coastguard Worker<h3> 115*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPEncoding"></a>xmlNanoHTTPEncoding ()</h3> 116*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">const char * xmlNanoHTTPEncoding (void * ctx)<br> 117*7c568831SAndroid Build Coastguard Worker</pre> 118*7c568831SAndroid Build Coastguard Worker<p>Provides the specified encoding if specified in the HTTP headers.</p> 119*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 120*7c568831SAndroid Build Coastguard Worker<col align="left"> 121*7c568831SAndroid Build Coastguard Worker<tbody> 122*7c568831SAndroid Build Coastguard Worker<tr> 123*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 124*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 125*7c568831SAndroid Build Coastguard Worker</tr> 126*7c568831SAndroid Build Coastguard Worker<tr> 127*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 128*7c568831SAndroid Build Coastguard Worker<td>the specified encoding or NULL if not available</td> 129*7c568831SAndroid Build Coastguard Worker</tr> 130*7c568831SAndroid Build Coastguard Worker</tbody> 131*7c568831SAndroid Build Coastguard Worker</table></div> 132*7c568831SAndroid Build Coastguard Worker</div> 133*7c568831SAndroid Build Coastguard Worker<hr> 134*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 135*7c568831SAndroid Build Coastguard Worker<h3> 136*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPFetch"></a>xmlNanoHTTPFetch ()</h3> 137*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">int xmlNanoHTTPFetch (const char * URL, <br> const char * filename, <br> char ** contentType)<br> 138*7c568831SAndroid Build Coastguard Worker</pre> 139*7c568831SAndroid Build Coastguard Worker<p>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</p> 140*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 141*7c568831SAndroid Build Coastguard Worker<col align="left"> 142*7c568831SAndroid Build Coastguard Worker<tbody> 143*7c568831SAndroid Build Coastguard Worker<tr> 144*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 145*7c568831SAndroid Build Coastguard Worker<td>The URL to load</td> 146*7c568831SAndroid Build Coastguard Worker</tr> 147*7c568831SAndroid Build Coastguard Worker<tr> 148*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>filename</tt></i>:</span></td> 149*7c568831SAndroid Build Coastguard Worker<td>the filename where the content should be saved</td> 150*7c568831SAndroid Build Coastguard Worker</tr> 151*7c568831SAndroid Build Coastguard Worker<tr> 152*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>contentType</tt></i>:</span></td> 153*7c568831SAndroid Build Coastguard Worker<td>if available the Content-Type information will be returned at that location</td> 154*7c568831SAndroid Build Coastguard Worker</tr> 155*7c568831SAndroid Build Coastguard Worker<tr> 156*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 157*7c568831SAndroid Build Coastguard Worker<td>-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller</td> 158*7c568831SAndroid Build Coastguard Worker</tr> 159*7c568831SAndroid Build Coastguard Worker</tbody> 160*7c568831SAndroid Build Coastguard Worker</table></div> 161*7c568831SAndroid Build Coastguard Worker</div> 162*7c568831SAndroid Build Coastguard Worker<hr> 163*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 164*7c568831SAndroid Build Coastguard Worker<h3> 165*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPInit"></a>xmlNanoHTTPInit ()</h3> 166*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void xmlNanoHTTPInit (void)<br> 167*7c568831SAndroid Build Coastguard Worker</pre> 168*7c568831SAndroid Build Coastguard Worker<p>Initialize the HTTP protocol layer. Currently it just checks for proxy information</p> 169*7c568831SAndroid Build Coastguard Worker</div> 170*7c568831SAndroid Build Coastguard Worker<hr> 171*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 172*7c568831SAndroid Build Coastguard Worker<h3> 173*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPMethod"></a>xmlNanoHTTPMethod ()</h3> 174*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void * xmlNanoHTTPMethod (const char * URL, <br> const char * method, <br> const char * input, <br> char ** contentType, <br> const char * headers, <br> int ilen)<br> 175*7c568831SAndroid Build Coastguard Worker</pre> 176*7c568831SAndroid Build Coastguard Worker<p>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.</p> 177*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 178*7c568831SAndroid Build Coastguard Worker<col align="left"> 179*7c568831SAndroid Build Coastguard Worker<tbody> 180*7c568831SAndroid Build Coastguard Worker<tr> 181*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 182*7c568831SAndroid Build Coastguard Worker<td>The URL to load</td> 183*7c568831SAndroid Build Coastguard Worker</tr> 184*7c568831SAndroid Build Coastguard Worker<tr> 185*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>method</tt></i>:</span></td> 186*7c568831SAndroid Build Coastguard Worker<td>the HTTP method to use</td> 187*7c568831SAndroid Build Coastguard Worker</tr> 188*7c568831SAndroid Build Coastguard Worker<tr> 189*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>input</tt></i>:</span></td> 190*7c568831SAndroid Build Coastguard Worker<td>the input string if any</td> 191*7c568831SAndroid Build Coastguard Worker</tr> 192*7c568831SAndroid Build Coastguard Worker<tr> 193*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>contentType</tt></i>:</span></td> 194*7c568831SAndroid Build Coastguard Worker<td>the Content-Type information IN and OUT</td> 195*7c568831SAndroid Build Coastguard Worker</tr> 196*7c568831SAndroid Build Coastguard Worker<tr> 197*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>headers</tt></i>:</span></td> 198*7c568831SAndroid Build Coastguard Worker<td>the extra headers</td> 199*7c568831SAndroid Build Coastguard Worker</tr> 200*7c568831SAndroid Build Coastguard Worker<tr> 201*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ilen</tt></i>:</span></td> 202*7c568831SAndroid Build Coastguard Worker<td>input length</td> 203*7c568831SAndroid Build Coastguard Worker</tr> 204*7c568831SAndroid Build Coastguard Worker<tr> 205*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 206*7c568831SAndroid Build Coastguard Worker<td>NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller</td> 207*7c568831SAndroid Build Coastguard Worker</tr> 208*7c568831SAndroid Build Coastguard Worker</tbody> 209*7c568831SAndroid Build Coastguard Worker</table></div> 210*7c568831SAndroid Build Coastguard Worker</div> 211*7c568831SAndroid Build Coastguard Worker<hr> 212*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 213*7c568831SAndroid Build Coastguard Worker<h3> 214*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPMethodRedir"></a>xmlNanoHTTPMethodRedir ()</h3> 215*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void * xmlNanoHTTPMethodRedir (const char * URL, <br> const char * method, <br> const char * input, <br> char ** contentType, <br> char ** redir, <br> const char * headers, <br> int ilen)<br> 216*7c568831SAndroid Build Coastguard Worker</pre> 217*7c568831SAndroid Build Coastguard Worker<p>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.</p> 218*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 219*7c568831SAndroid Build Coastguard Worker<col align="left"> 220*7c568831SAndroid Build Coastguard Worker<tbody> 221*7c568831SAndroid Build Coastguard Worker<tr> 222*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 223*7c568831SAndroid Build Coastguard Worker<td>The URL to load</td> 224*7c568831SAndroid Build Coastguard Worker</tr> 225*7c568831SAndroid Build Coastguard Worker<tr> 226*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>method</tt></i>:</span></td> 227*7c568831SAndroid Build Coastguard Worker<td>the HTTP method to use</td> 228*7c568831SAndroid Build Coastguard Worker</tr> 229*7c568831SAndroid Build Coastguard Worker<tr> 230*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>input</tt></i>:</span></td> 231*7c568831SAndroid Build Coastguard Worker<td>the input string if any</td> 232*7c568831SAndroid Build Coastguard Worker</tr> 233*7c568831SAndroid Build Coastguard Worker<tr> 234*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>contentType</tt></i>:</span></td> 235*7c568831SAndroid Build Coastguard Worker<td>the Content-Type information IN and OUT</td> 236*7c568831SAndroid Build Coastguard Worker</tr> 237*7c568831SAndroid Build Coastguard Worker<tr> 238*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>redir</tt></i>:</span></td> 239*7c568831SAndroid Build Coastguard Worker<td>the redirected URL OUT</td> 240*7c568831SAndroid Build Coastguard Worker</tr> 241*7c568831SAndroid Build Coastguard Worker<tr> 242*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>headers</tt></i>:</span></td> 243*7c568831SAndroid Build Coastguard Worker<td>the extra headers</td> 244*7c568831SAndroid Build Coastguard Worker</tr> 245*7c568831SAndroid Build Coastguard Worker<tr> 246*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ilen</tt></i>:</span></td> 247*7c568831SAndroid Build Coastguard Worker<td>input length</td> 248*7c568831SAndroid Build Coastguard Worker</tr> 249*7c568831SAndroid Build Coastguard Worker<tr> 250*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 251*7c568831SAndroid Build Coastguard Worker<td>NULL in case of failure, otherwise a request handler. The contentType, or redir, if provided must be freed by the caller</td> 252*7c568831SAndroid Build Coastguard Worker</tr> 253*7c568831SAndroid Build Coastguard Worker</tbody> 254*7c568831SAndroid Build Coastguard Worker</table></div> 255*7c568831SAndroid Build Coastguard Worker</div> 256*7c568831SAndroid Build Coastguard Worker<hr> 257*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 258*7c568831SAndroid Build Coastguard Worker<h3> 259*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPMimeType"></a>xmlNanoHTTPMimeType ()</h3> 260*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">const char * xmlNanoHTTPMimeType (void * ctx)<br> 261*7c568831SAndroid Build Coastguard Worker</pre> 262*7c568831SAndroid Build Coastguard Worker<p>Provides the specified Mime-Type if specified in the HTTP headers.</p> 263*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 264*7c568831SAndroid Build Coastguard Worker<col align="left"> 265*7c568831SAndroid Build Coastguard Worker<tbody> 266*7c568831SAndroid Build Coastguard Worker<tr> 267*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 268*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 269*7c568831SAndroid Build Coastguard Worker</tr> 270*7c568831SAndroid Build Coastguard Worker<tr> 271*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 272*7c568831SAndroid Build Coastguard Worker<td>the specified Mime-Type or NULL if not available</td> 273*7c568831SAndroid Build Coastguard Worker</tr> 274*7c568831SAndroid Build Coastguard Worker</tbody> 275*7c568831SAndroid Build Coastguard Worker</table></div> 276*7c568831SAndroid Build Coastguard Worker</div> 277*7c568831SAndroid Build Coastguard Worker<hr> 278*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 279*7c568831SAndroid Build Coastguard Worker<h3> 280*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPOpen"></a>xmlNanoHTTPOpen ()</h3> 281*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void * xmlNanoHTTPOpen (const char * URL, <br> char ** contentType)<br> 282*7c568831SAndroid Build Coastguard Worker</pre> 283*7c568831SAndroid Build Coastguard Worker<p>This function try to open a connection to the indicated resource via HTTP GET.</p> 284*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 285*7c568831SAndroid Build Coastguard Worker<col align="left"> 286*7c568831SAndroid Build Coastguard Worker<tbody> 287*7c568831SAndroid Build Coastguard Worker<tr> 288*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 289*7c568831SAndroid Build Coastguard Worker<td>The URL to load</td> 290*7c568831SAndroid Build Coastguard Worker</tr> 291*7c568831SAndroid Build Coastguard Worker<tr> 292*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>contentType</tt></i>:</span></td> 293*7c568831SAndroid Build Coastguard Worker<td>if available the Content-Type information will be returned at that location</td> 294*7c568831SAndroid Build Coastguard Worker</tr> 295*7c568831SAndroid Build Coastguard Worker<tr> 296*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 297*7c568831SAndroid Build Coastguard Worker<td>NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller</td> 298*7c568831SAndroid Build Coastguard Worker</tr> 299*7c568831SAndroid Build Coastguard Worker</tbody> 300*7c568831SAndroid Build Coastguard Worker</table></div> 301*7c568831SAndroid Build Coastguard Worker</div> 302*7c568831SAndroid Build Coastguard Worker<hr> 303*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 304*7c568831SAndroid Build Coastguard Worker<h3> 305*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPOpenRedir"></a>xmlNanoHTTPOpenRedir ()</h3> 306*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void * xmlNanoHTTPOpenRedir (const char * URL, <br> char ** contentType, <br> char ** redir)<br> 307*7c568831SAndroid Build Coastguard Worker</pre> 308*7c568831SAndroid Build Coastguard Worker<p>This function try to open a connection to the indicated resource via HTTP GET.</p> 309*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 310*7c568831SAndroid Build Coastguard Worker<col align="left"> 311*7c568831SAndroid Build Coastguard Worker<tbody> 312*7c568831SAndroid Build Coastguard Worker<tr> 313*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 314*7c568831SAndroid Build Coastguard Worker<td>The URL to load</td> 315*7c568831SAndroid Build Coastguard Worker</tr> 316*7c568831SAndroid Build Coastguard Worker<tr> 317*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>contentType</tt></i>:</span></td> 318*7c568831SAndroid Build Coastguard Worker<td>if available the Content-Type information will be returned at that location</td> 319*7c568831SAndroid Build Coastguard Worker</tr> 320*7c568831SAndroid Build Coastguard Worker<tr> 321*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>redir</tt></i>:</span></td> 322*7c568831SAndroid Build Coastguard Worker<td>if available the redirected URL will be returned</td> 323*7c568831SAndroid Build Coastguard Worker</tr> 324*7c568831SAndroid Build Coastguard Worker<tr> 325*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 326*7c568831SAndroid Build Coastguard Worker<td>NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller</td> 327*7c568831SAndroid Build Coastguard Worker</tr> 328*7c568831SAndroid Build Coastguard Worker</tbody> 329*7c568831SAndroid Build Coastguard Worker</table></div> 330*7c568831SAndroid Build Coastguard Worker</div> 331*7c568831SAndroid Build Coastguard Worker<hr> 332*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 333*7c568831SAndroid Build Coastguard Worker<h3> 334*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPRead"></a>xmlNanoHTTPRead ()</h3> 335*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">int xmlNanoHTTPRead (void * ctx, <br> void * dest, <br> int len)<br> 336*7c568831SAndroid Build Coastguard Worker</pre> 337*7c568831SAndroid Build Coastguard Worker<p>This function tries to read @len bytes from the existing HTTP connection and saves them in @dest. This is a blocking call.</p> 338*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 339*7c568831SAndroid Build Coastguard Worker<col align="left"> 340*7c568831SAndroid Build Coastguard Worker<tbody> 341*7c568831SAndroid Build Coastguard Worker<tr> 342*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 343*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 344*7c568831SAndroid Build Coastguard Worker</tr> 345*7c568831SAndroid Build Coastguard Worker<tr> 346*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>dest</tt></i>:</span></td> 347*7c568831SAndroid Build Coastguard Worker<td>a buffer</td> 348*7c568831SAndroid Build Coastguard Worker</tr> 349*7c568831SAndroid Build Coastguard Worker<tr> 350*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>len</tt></i>:</span></td> 351*7c568831SAndroid Build Coastguard Worker<td>the buffer length</td> 352*7c568831SAndroid Build Coastguard Worker</tr> 353*7c568831SAndroid Build Coastguard Worker<tr> 354*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 355*7c568831SAndroid Build Coastguard Worker<td>the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.</td> 356*7c568831SAndroid Build Coastguard Worker</tr> 357*7c568831SAndroid Build Coastguard Worker</tbody> 358*7c568831SAndroid Build Coastguard Worker</table></div> 359*7c568831SAndroid Build Coastguard Worker</div> 360*7c568831SAndroid Build Coastguard Worker<hr> 361*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 362*7c568831SAndroid Build Coastguard Worker<h3> 363*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPRedir"></a>xmlNanoHTTPRedir ()</h3> 364*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">const char * xmlNanoHTTPRedir (void * ctx)<br> 365*7c568831SAndroid Build Coastguard Worker</pre> 366*7c568831SAndroid Build Coastguard Worker<p>Provides the specified redirection URL if available from the HTTP header.</p> 367*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 368*7c568831SAndroid Build Coastguard Worker<col align="left"> 369*7c568831SAndroid Build Coastguard Worker<tbody> 370*7c568831SAndroid Build Coastguard Worker<tr> 371*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 372*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 373*7c568831SAndroid Build Coastguard Worker</tr> 374*7c568831SAndroid Build Coastguard Worker<tr> 375*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 376*7c568831SAndroid Build Coastguard Worker<td>the specified redirection URL or NULL if not redirected.</td> 377*7c568831SAndroid Build Coastguard Worker</tr> 378*7c568831SAndroid Build Coastguard Worker</tbody> 379*7c568831SAndroid Build Coastguard Worker</table></div> 380*7c568831SAndroid Build Coastguard Worker</div> 381*7c568831SAndroid Build Coastguard Worker<hr> 382*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 383*7c568831SAndroid Build Coastguard Worker<h3> 384*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPReturnCode"></a>xmlNanoHTTPReturnCode ()</h3> 385*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">int xmlNanoHTTPReturnCode (void * ctx)<br> 386*7c568831SAndroid Build Coastguard Worker</pre> 387*7c568831SAndroid Build Coastguard Worker<p>Get the latest HTTP return code received</p> 388*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 389*7c568831SAndroid Build Coastguard Worker<col align="left"> 390*7c568831SAndroid Build Coastguard Worker<tbody> 391*7c568831SAndroid Build Coastguard Worker<tr> 392*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctx</tt></i>:</span></td> 393*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 394*7c568831SAndroid Build Coastguard Worker</tr> 395*7c568831SAndroid Build Coastguard Worker<tr> 396*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 397*7c568831SAndroid Build Coastguard Worker<td>the HTTP return code for the request.</td> 398*7c568831SAndroid Build Coastguard Worker</tr> 399*7c568831SAndroid Build Coastguard Worker</tbody> 400*7c568831SAndroid Build Coastguard Worker</table></div> 401*7c568831SAndroid Build Coastguard Worker</div> 402*7c568831SAndroid Build Coastguard Worker<hr> 403*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 404*7c568831SAndroid Build Coastguard Worker<h3> 405*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPSave"></a>xmlNanoHTTPSave ()</h3> 406*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">int xmlNanoHTTPSave (void * ctxt, <br> const char * filename)<br> 407*7c568831SAndroid Build Coastguard Worker</pre> 408*7c568831SAndroid Build Coastguard Worker<p>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</p> 409*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 410*7c568831SAndroid Build Coastguard Worker<col align="left"> 411*7c568831SAndroid Build Coastguard Worker<tbody> 412*7c568831SAndroid Build Coastguard Worker<tr> 413*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>ctxt</tt></i>:</span></td> 414*7c568831SAndroid Build Coastguard Worker<td>the HTTP context</td> 415*7c568831SAndroid Build Coastguard Worker</tr> 416*7c568831SAndroid Build Coastguard Worker<tr> 417*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>filename</tt></i>:</span></td> 418*7c568831SAndroid Build Coastguard Worker<td>the filename where the content should be saved</td> 419*7c568831SAndroid Build Coastguard Worker</tr> 420*7c568831SAndroid Build Coastguard Worker<tr> 421*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>Returns</tt></i>:</span></td> 422*7c568831SAndroid Build Coastguard Worker<td>-1 in case of failure, 0 in case of success.</td> 423*7c568831SAndroid Build Coastguard Worker</tr> 424*7c568831SAndroid Build Coastguard Worker</tbody> 425*7c568831SAndroid Build Coastguard Worker</table></div> 426*7c568831SAndroid Build Coastguard Worker</div> 427*7c568831SAndroid Build Coastguard Worker<hr> 428*7c568831SAndroid Build Coastguard Worker<div class="refsect2" lang="en"> 429*7c568831SAndroid Build Coastguard Worker<h3> 430*7c568831SAndroid Build Coastguard Worker<a name="xmlNanoHTTPScanProxy"></a>xmlNanoHTTPScanProxy ()</h3> 431*7c568831SAndroid Build Coastguard Worker<pre class="programlisting">void xmlNanoHTTPScanProxy (const char * URL)<br> 432*7c568831SAndroid Build Coastguard Worker</pre> 433*7c568831SAndroid Build Coastguard Worker<p>(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.</p> 434*7c568831SAndroid Build Coastguard Worker<div class="variablelist"><table border="0"> 435*7c568831SAndroid Build Coastguard Worker<col align="left"> 436*7c568831SAndroid Build Coastguard Worker<tbody><tr> 437*7c568831SAndroid Build Coastguard Worker<td><span class="term"><i><tt>URL</tt></i>:</span></td> 438*7c568831SAndroid Build Coastguard Worker<td>The proxy URL used to initialize the proxy context</td> 439*7c568831SAndroid Build Coastguard Worker</tr></tbody> 440*7c568831SAndroid Build Coastguard Worker</table></div> 441*7c568831SAndroid Build Coastguard Worker</div> 442*7c568831SAndroid Build Coastguard Worker<hr> 443*7c568831SAndroid Build Coastguard Worker</div> 444*7c568831SAndroid Build Coastguard Worker</div> 445*7c568831SAndroid Build Coastguard Worker</body> 446*7c568831SAndroid Build Coastguard Worker</html> 447