added Info.plist
[TestXSLT.git] / libxml2 / doc / html / libxml-nanohttp.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>nanohttp</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
2         .synopsis, .classsynopsis {
3             background: #eeeeee;
4             border: solid 1px #aaaaaa;
5             padding: 0.5em;
6         }
7         .programlisting {
8             background: #eeeeff;
9             border: solid 1px #aaaaff;
10             padding: 0.5em;
11         }
12         .variablelist {
13             padding: 4px;
14             margin-left: 3em;
15         }
16         .navigation {
17             background: #ffeeee;
18             border: solid 1px #ffaaaa;
19             margin-top: 0.5em;
20             margin-bottom: 0.5em;
21         }
22         .navigation a {
23             color: #770000;
24         }
25         .navigation a:visited {
26             color: #550000;
27         }
28         .navigation .title {
29             font-size: 200%;
30         }
31       </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-xinclude.html" title="xinclude"><link rel="next" href="libxml-nanoftp.html" title="nanoftp"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xinclude.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-nanoftp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-nanohttp"></a><div class="titlepage"></div><div class="refnamediv"><h2>nanohttp</h2><p>nanohttp &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
32
33
34
35 void        <a href="libxml-nanohttp.html#xmlNanoHTTPInit">xmlNanoHTTPInit</a>                 (void);
36 void        <a href="libxml-nanohttp.html#xmlNanoHTTPCleanup">xmlNanoHTTPCleanup</a>              (void);
37 void        <a href="libxml-nanohttp.html#xmlNanoHTTPScanProxy">xmlNanoHTTPScanProxy</a>            (const char *URL);
38 int         <a href="libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a>                (const char *URL,
39                                              const char *filename,
40                                              char **contentType);
41 void*       <a href="libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a>               (const char *URL,
42                                              const char *method,
43                                              const char *input,
44                                              char **contentType,
45                                              const char *headers,
46                                              int ilen);
47 void*       <a href="libxml-nanohttp.html#xmlNanoHTTPMethodRedir">xmlNanoHTTPMethodRedir</a>          (const char *URL,
48                                              const char *method,
49                                              const char *input,
50                                              char **contentType,
51                                              char **redir,
52                                              const char *headers,
53                                              int ilen);
54 void*       <a href="libxml-nanohttp.html#xmlNanoHTTPOpen">xmlNanoHTTPOpen</a>                 (const char *URL,
55                                              char **contentType);
56 void*       <a href="libxml-nanohttp.html#xmlNanoHTTPOpenRedir">xmlNanoHTTPOpenRedir</a>            (const char *URL,
57                                              char **contentType,
58                                              char **redir);
59 int         <a href="libxml-nanohttp.html#xmlNanoHTTPReturnCode">xmlNanoHTTPReturnCode</a>           (void *ctx);
60 const char* <a href="libxml-nanohttp.html#xmlNanoHTTPAuthHeader">xmlNanoHTTPAuthHeader</a>           (void *ctx);
61 int         <a href="libxml-nanohttp.html#xmlNanoHTTPRead">xmlNanoHTTPRead</a>                 (void *ctx,
62                                              void *dest,
63                                              int len);
64 int         <a href="libxml-nanohttp.html#xmlNanoHTTPSave">xmlNanoHTTPSave</a>                 (void *ctxt,
65                                              const char *filename);
66 void        <a href="libxml-nanohttp.html#xmlNanoHTTPClose">xmlNanoHTTPClose</a>                (void *ctx);
67 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
68
69 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPInit"></a>xmlNanoHTTPInit ()</h3><pre class="programlisting">void        xmlNanoHTTPInit                 (void);</pre><p>
70 Initialize the HTTP protocol layer.
71 Currently it just checks for proxy informations</p><p>
72
73 </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPCleanup"></a>xmlNanoHTTPCleanup ()</h3><pre class="programlisting">void        xmlNanoHTTPCleanup              (void);</pre><p>
74 Cleanup the HTTP protocol layer.</p><p>
75
76 </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPScanProxy"></a>xmlNanoHTTPScanProxy ()</h3><pre class="programlisting">void        xmlNanoHTTPScanProxy            (const char *URL);</pre><p>
77 (Re)Initialize the HTTP Proxy context by parsing the URL and finding
78 the protocol host port it indicates.
79 Should be like http://myproxy/ or http://myproxy:3128/
80 A NULL URL cleans up proxy informations.</p><p>
81
82 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The proxy URL used to initialize the proxy context
83 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPFetch"></a>xmlNanoHTTPFetch ()</h3><pre class="programlisting">int         xmlNanoHTTPFetch                (const char *URL,
84                                              const char *filename,
85                                              char **contentType);</pre><p>
86 This function try to fetch the indicated resource via HTTP GET
87 and save it's content in the file.</p><p>
88
89 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The URL to load
90 </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td>  the filename where the content should be saved
91 </td></tr><tr><td><span class="term"><i><tt>contentType</tt></i> :</span></td><td>  if available the Content-Type information will be
92                returned at that location
93 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of failure, 0 incase of success. The contentType,
94     if provided must be freed by the caller
95 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPMethod"></a>xmlNanoHTTPMethod ()</h3><pre class="programlisting">void*       xmlNanoHTTPMethod               (const char *URL,
96                                              const char *method,
97                                              const char *input,
98                                              char **contentType,
99                                              const char *headers,
100                                              int ilen);</pre><p>
101 This function try to open a connection to the indicated resource
102 via HTTP using the given <i><tt>method</tt></i>, adding the given extra headers
103 and the input buffer for the request content.</p><p>
104
105 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The URL to load
106 </td></tr><tr><td><span class="term"><i><tt>method</tt></i> :</span></td><td>  the HTTP method to use
107 </td></tr><tr><td><span class="term"><i><tt>input</tt></i> :</span></td><td>  the input string if any
108 </td></tr><tr><td><span class="term"><i><tt>contentType</tt></i> :</span></td><td>  the Content-Type information IN and OUT
109 </td></tr><tr><td><span class="term"><i><tt>headers</tt></i> :</span></td><td>  the extra headers
110 </td></tr><tr><td><span class="term"><i><tt>ilen</tt></i> :</span></td><td>  input length
111 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPMethodRedir"></a>xmlNanoHTTPMethodRedir ()</h3><pre class="programlisting">void*       xmlNanoHTTPMethodRedir          (const char *URL,
112                                              const char *method,
113                                              const char *input,
114                                              char **contentType,
115                                              char **redir,
116                                              const char *headers,
117                                              int ilen);</pre><p>
118 This function try to open a connection to the indicated resource
119 via HTTP using the given <i><tt>method</tt></i>, adding the given extra headers
120 and the input buffer for the request content.</p><p>
121
122 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The URL to load
123 </td></tr><tr><td><span class="term"><i><tt>method</tt></i> :</span></td><td>  the HTTP method to use
124 </td></tr><tr><td><span class="term"><i><tt>input</tt></i> :</span></td><td>  the input string if any
125 </td></tr><tr><td><span class="term"><i><tt>contentType</tt></i> :</span></td><td>  the Content-Type information IN and OUT
126 </td></tr><tr><td><span class="term"><i><tt>redir</tt></i> :</span></td><td>  the redirected URL OUT
127 </td></tr><tr><td><span class="term"><i><tt>headers</tt></i> :</span></td><td>  the extra headers
128 </td></tr><tr><td><span class="term"><i><tt>ilen</tt></i> :</span></td><td>  input length
129 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPOpen"></a>xmlNanoHTTPOpen ()</h3><pre class="programlisting">void*       xmlNanoHTTPOpen                 (const char *URL,
130                                              char **contentType);</pre><p>
131 This function try to open a connection to the indicated resource
132 via HTTP GET.</p><p>
133
134 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The URL to load
135 </td></tr><tr><td><span class="term"><i><tt>contentType</tt></i> :</span></td><td>  if available the Content-Type information will be
136                returned at that location
137 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPOpenRedir"></a>xmlNanoHTTPOpenRedir ()</h3><pre class="programlisting">void*       xmlNanoHTTPOpenRedir            (const char *URL,
138                                              char **contentType,
139                                              char **redir);</pre><p>
140 This function try to open a connection to the indicated resource
141 via HTTP GET.</p><p>
142
143 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td>  The URL to load
144 </td></tr><tr><td><span class="term"><i><tt>contentType</tt></i> :</span></td><td>  if available the Content-Type information will be
145                returned at that location
146 </td></tr><tr><td><span class="term"><i><tt>redir</tt></i> :</span></td><td> if available the redirected URL will be returned
147 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPReturnCode"></a>xmlNanoHTTPReturnCode ()</h3><pre class="programlisting">int         xmlNanoHTTPReturnCode           (void *ctx);</pre><p>
148 Get the latest HTTP return code received</p><p>
149
150 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td>  the HTTP context
151 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the HTTP return code for the request.
152 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPAuthHeader"></a>xmlNanoHTTPAuthHeader ()</h3><pre class="programlisting">const char* xmlNanoHTTPAuthHeader           (void *ctx);</pre><p>
153 Get the authentication header of an HTTP context</p><p>
154
155 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td>  the HTTP context
156 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the stashed value of the WWW-Authenticate or Proxy-Authenticate
157 header.
158 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPRead"></a>xmlNanoHTTPRead ()</h3><pre class="programlisting">int         xmlNanoHTTPRead                 (void *ctx,
159                                              void *dest,
160                                              int len);</pre><p>
161 This function tries to read <i><tt>len</tt></i> bytes from the existing HTTP connection
162 and saves them in <i><tt>dest</tt></i>. This is a blocking call.</p><p>
163
164 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td>  the HTTP context
165 </td></tr><tr><td><span class="term"><i><tt>dest</tt></i> :</span></td><td>  a buffer
166 </td></tr><tr><td><span class="term"><i><tt>len</tt></i> :</span></td><td>  the buffer length
167 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of byte read. 0 is an indication of an end of connection.
168         -1 indicates a parameter error.
169 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPSave"></a>xmlNanoHTTPSave ()</h3><pre class="programlisting">int         xmlNanoHTTPSave                 (void *ctxt,
170                                              const char *filename);</pre><p>
171 This function saves the output of the HTTP transaction to a file
172 It closes and free the context at the end</p><p>
173
174 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i> :</span></td><td>  the HTTP context
175 </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td>  the filename where the content should be saved
176 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of failure, 0 incase of success.
177 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPClose"></a>xmlNanoHTTPClose ()</h3><pre class="programlisting">void        xmlNanoHTTPClose                (void *ctx);</pre><p>
178 This function closes an HTTP context, it ends up the connection and
179 free all data related to it.</p><p>
180
181 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td>  the HTTP context
182 </td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-xinclude.html"><b>&lt;&lt; xinclude</b></a></td><td align="right"><a accesskey="n" href="libxml-nanoftp.html"><b>nanoftp &gt;&gt;</b></a></td></tr></table></body></html>