- split off query strin API and use it in
[m6w6/ext-http] / docs / functions.html
index 7871ba15e6b549625a47cdd7b3f432de50b66448..7139f2a924e9d612ae200d32a9a2f7dcef53f867 100644 (file)
@@ -74,7 +74,7 @@
 looking like: "Wed, 22 Dec 2004 11:34:47 GMT"</p>
 <p>Accepts an optional unix timestamp as parameter.</p>
 <p>Returns the HTTP date as string.</p>
-<h2 id="http_build_url">string http_build_url(mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]])</h2>
+<h2 id="http_build_url">string http_build_url([mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]]])</h2>
 <p>Build an URL.</p>
 <p>Expexts (part(s) of) an URL as first parameter in form of a string or assoziative array<br />
 like parse_url() returns.  Accepts an optional second parameter in the same way as the<br />
@@ -84,7 +84,7 @@ with the results as associative array like parse_url() would return.</p>
 <p>The parts of the second URL will be merged into the first according to the flags argument.<br />
 The following flags are recognized:</p><pre>   - HTTP_URL_REPLACE:        (default) set parts of the second url will replace the parts in the first<br />
        - HTTP_URL_JOIN_PATH:      the path of the second url will be merged into the one of the first<br />
-       - HTTP_URL_JOIN_QUERY:     the two querystrings will be merged naivly; no replacements are done<br />
+       - HTTP_URL_JOIN_QUERY:     the two querystrings will be merged recursively<br />
        - HTTP_URL_STRIP_USER:     the user part will not appear in the result<br />
        - HTTP_URL_STRIP_PASS:     the password part will not appear in the result<br />
        - HTTP_URL_STRIP_AUTH:     neither the user nor the password part will appear in the result<br />
@@ -310,6 +310,7 @@ array where the following keys will be recognized:</p><pre> - redirect:
                      redirects to a different host<br />
  - proxyhost:        string, proxy host in "host[:port]" format<br />
  - proxyport:        int, use another proxy port as specified in proxyhost<br />
+ - proxytype:        int, HTTP_PROXY_HTTP, SOCKS4 or SOCKS5<br />
  - proxyauth:        string, proxy credentials in "user:pass" format<br />
  - proxyauthtype:    int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM<br />
  - httpauth:         string, http credentials in "user:pass" format<br />
@@ -329,6 +330,9 @@ array where the following keys will be recognized:</p><pre> - redirect:
  - cookiesession:    bool, accept (true) or reset (false) sessioncookies<br />
  - resume:           int, byte offset to start the download from;<br />
                      if the server supports ranges<br />
+ - range:            array, array of arrays, each containing two integers,<br />
+                     specifying the ranges to download if server support is<br />
+                     given; only recognized if the resume option is empty<br />
  - maxfilesize:      int, maximum file size that should be downloaded;<br />
                      has no effect, if the size of the requested entity is not known<br />
  - lastmodified:     int, timestamp for If-(Un)Modified-Since header<br />
@@ -386,7 +390,21 @@ See http_get() for a full list of available options.</p>
 <p>Expects the second parameter to be a resource referencing an already <br />
 opened stream, from which the data to upload should be read.<br />
 See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success. or FALSE on failure.</p>
+<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
+<h2 id="http_put_data">string http_put_data(string url, string data[, array options[, array &info]])</h2>
+<p>Performs an HTTP PUT request on the supplied url.</p>
+<p>Expects the second parameter to be a string containing the data to upload.<br />
+See http_get() for a full list of available options.</p>
+<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
+<h2 id="http_request">string http_request(int method, string url[, string body[, array options[, array &info]]])</h2>
+<p>Performs a custom HTTP request on the supplied url.</p>
+<p>Expects the first parameter to be an integer specifying the request method to use.<br />
+Accepts an optional third string parameter containing the raw request body.<br />
+See http_get() for a full list of available options.</p>
+<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
+<h2 id="http_request_body_encode">string http_request_body_encode(array fields, array files)</h2>
+<p>Generate x-www-form-urlencoded resp. form-data encoded request body.</p>
+<p>Returns encoded string on success, or FALSE on failure.</p>
 <h2 id="http_request_method_register">int http_request_method_register(string method)</h2>
 <p>Register a custom request method.</p>
 <p>Expects a string parameter containing the request method name to register.</p>
@@ -458,6 +476,9 @@ all supported features.</p>
 <hr noshade>
 <h1 id="http_inflatestream_object.c">http_inflatestream_object.c</h1>
 <h2 id="HttpInflateStream" class="o">HttpInflateStream</h2>
+<h3 id="HttpInflateStream___construct">void HttpInflateStream::__construct([int flags = 0])</h3>
+<p>Creates a new HttpInflateStream object instance.</p>
+<p>Accepts an optional int parameter specifying how to initialize the inflate stream.</p>
 <h3 id="HttpInflateStream_update">string HttpInflateStream::update(string data)</h3>
 <p>Passes more data through the inflate stream.</p>
 <p>Expects a string parameter containing (a part of) the data to inflate.</p>
@@ -557,6 +578,7 @@ HttpMessage::TYPE_REQUEST or supplied URL was empty.</p>
 <h3 id="HttpMessage_getParentMessage">HttpMessage HttpMessage::getParentMessage()</h3>
 <p>Get parent Message.</p>
 <p>Returns the parent HttpMessage on success, or NULL if there's none.</p>
+<p>Throws HttpRuntimeException.</p>
 <h3 id="HttpMessage_send">bool HttpMessage::send()</h3>
 <p>Send the Message according to its type as Response or Request.<br />
 This provides limited functionality compared to HttpRequest and HttpResponse.</p>
@@ -581,9 +603,10 @@ should also contain any parent messages.</p>
 <p>Re-constructs the HttpMessage based upon the serialized string.</p>
 <h3 id="HttpMessage_detach">HttpMessage HttpMessage::detach(void)</h3>
 <p>Returns a clone of an HttpMessage object detached from any parent messages.</p>
-<h3 id="HttpMessage_prepend">void HttpMessage::prepend(HttpMessage message)</h3>
+<h3 id="HttpMessage_prepend">void HttpMessage::prepend(HttpMessage message[, bool top = true])</h3>
 <p>Prepends message(s) to the HTTP message.</p>
 <p>Expects an HttpMessage object as parameter.</p>
+<p>Throws HttpInvalidParamException if the message is located within the same message chain.</p>
 <h3 id="HttpMessage_reverse">HttpMessage HttpMessage::reverse()</h3>
 <p>Reorders the message chain in reverse order.</p>
 <p>Returns the most parent HttpMessage object.</p>
@@ -600,7 +623,7 @@ should also contain any parent messages.</p>
 <hr noshade>
 <h1 id="http_querystring_object.c">http_querystring_object.c</h1>
 <h2 id="HttpQueryString" class="o">HttpQueryString</h2>
-<h3 id="HttpQueryString___construct">void HttpQueryString::__construct([bool global = true[, mixed add])</h3>
+<h3 id="HttpQueryString___construct">final void HttpQueryString::__construct([bool global = true[, mixed add])</h3>
 <p>Creates a new HttpQueryString object instance.<br />
 Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.</p>
 <h3 id="HttpQueryString_toString">string HttpQueryString::toString()</h3>
@@ -613,8 +636,16 @@ Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.</
 "b" for bool, "i" for int, "f" for float, "s" for string, "a" for array and "o" for a stdClass object.</p>
 <h3 id="HttpQueryString_set">string HttpQueryString::set(mixed params)</h3>
 <p>Set query string entry/entries. NULL values will unset the variable.</p>
-<h3 id="HttpQueryString_getInstance">HttpQueryString HttpQueryString::getInstance([bool global = true])</h3>
+<h3 id="HttpQueryString_singleton">static HttpQueryString HttpQueryString::singleton([bool global = true])</h3>
 <p>Get a single instance (differentiates between the global setting).</p>
+<h3 id="HttpQueryString_xlate">bool HttpQueryString::xlate(string ie, string oe)</h3>
+<p>Converts the query string from the source encoding ie to the target encoding oe.<br />
+WARNING: Don't use any character set that can contain NUL bytes like UTF-16.</p>
+<p>Returns TRUE on success or FALSE on failure.</p>
+<h3 id="HttpQueryString_serialize">string HttpQueryString::serialize()</h3>
+<p>Implements Serializable.</p>
+<h3 id="HttpQueryString_unserialize">void HttpQueryString::unserialize(string serialized)</h3>
+<p>Implements Serializable.</p>
 <hr noshade>
 <h1 id="http_request_object.c">http_request_object.c</h1>
 <h2 id="HttpRequest" class="o">HttpRequest</h2>
@@ -769,6 +800,22 @@ If the parameter is empty or omitted the put file will be unset.</p>
 <h3 id="HttpRequest_getPutFile">string HttpRequest::getPutFile()</h3>
 <p>Get previously set put file.</p>
 <p>Returns a string containing the path to the currently set put file.</p>
+<h3 id="HttpRequest_setPutData">bool HttpRequest::setPutData([string put_data])</h3>
+<p>Set PUT data to send, overwriting previously set PUT data.<br />
+Affects only PUT requests.<br />
+Only either PUT data or PUT file can be used for each request.<br />
+PUT data has higher precedence and will be used even if a PUT<br />
+file is set.  </p>
+<p>Accepts a string as parameter containing the data to upload.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_addPutData">bool HttpRequest::addPutData(string put_data)</h3>
+<p>Add PUT data, leaving previously set PUT data unchanged.<br />
+Affects only PUT requests.</p>
+<p>Expects a string as parameter containing the data to concatenate.</p>
+<p>Returns TRUE on success, or FALSE on failure.</p>
+<h3 id="HttpRequest_getPutData">string HttpRequest::getPutData()</h3>
+<p>Get previously set PUT data.</p>
+<p>Returns a string containing the currently set raw post data.</p>
 <h3 id="HttpRequest_getResponseData">array HttpRequest::getResponseData()</h3>
 <p>Get all response data after the request has been sent.</p>
 <p>Returns an associative array with the key "headers" containing an associative<br />
@@ -820,7 +867,7 @@ references the last received response.</p>
 references the last received response.  Use HttpMessage::getParentMessage()<br />
 to access the data of previously received responses within this request<br />
 cycle.</p>
-<p>Throws HttpException.</p>
+<p>Throws HttpException, HttpRuntimeException.</p>
 <h3 id="HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()</h3>
 <p>Get sent HTTP message.</p>
 <p>Returns an HttpMessage object representing the sent request.</p>
@@ -949,6 +996,7 @@ parameter is unset no header with this name will be sent. </p>
 <p>Accepts a string as optional parameter which specifies the name of the<br />
 header to read.  If the parameter is empty or omitted, an associative array<br />
 with all headers will be returned.</p>
+<p>NOTE: In Apache2 this only works for PHP-5.1.3 and greater.</p>
 <p>Returns either a string containing the value of the header matching name,<br />
 FALSE on failure, or an associative array with all headers.</p>
 <h3 id="HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)</h3>
@@ -1163,6 +1211,12 @@ http.cache_log is set.</p>
 </li>
 <li><a href="#http_put_stream">http_put_stream</a>
 </li>
+<li><a href="#http_put_data">http_put_data</a>
+</li>
+<li><a href="#http_request">http_request</a>
+</li>
+<li><a href="#http_request_body_encode">http_request_body_encode</a>
+</li>
 <li><a href="#http_request_method_register">http_request_method_register</a>
 </li>
 <li><a href="#http_request_method_unregister">http_request_method_unregister</a>
@@ -1194,6 +1248,7 @@ http.cache_log is set.</p>
 </li>
 <li><a class="tocfile" href="#http_inflatestream_object.c">http_inflatestream_object.c</a>
 <ul>
+<li><a href="#HttpInflateStream___construct">HttpInflateStream::__construct()</a></li>
 <li><a href="#HttpInflateStream_update">HttpInflateStream::update()</a></li>
 <li><a href="#HttpInflateStream_flush">HttpInflateStream::flush()</a></li>
 <li><a href="#HttpInflateStream_finish">HttpInflateStream::finish()</a></li>
@@ -1246,7 +1301,10 @@ http.cache_log is set.</p>
 <li><a href="#HttpQueryString_toArray">HttpQueryString::toArray()</a></li>
 <li><a href="#HttpQueryString_get">HttpQueryString::get()</a></li>
 <li><a href="#HttpQueryString_set">HttpQueryString::set()</a></li>
-<li><a href="#HttpQueryString_getInstance">HttpQueryString::getInstance()</a></li>
+<li><a href="#HttpQueryString_singleton">HttpQueryString::singleton()</a></li>
+<li><a href="#HttpQueryString_xlate">HttpQueryString::xlate()</a></li>
+<li><a href="#HttpQueryString_serialize">HttpQueryString::serialize()</a></li>
+<li><a href="#HttpQueryString_unserialize">HttpQueryString::unserialize()</a></li>
 </li>
 </ul>
 </li>
@@ -1284,6 +1342,9 @@ http.cache_log is set.</p>
 <li><a href="#HttpRequest_getPostFiles">HttpRequest::getPostFiles()</a></li>
 <li><a href="#HttpRequest_setPutFile">HttpRequest::setPutFile()</a></li>
 <li><a href="#HttpRequest_getPutFile">HttpRequest::getPutFile()</a></li>
+<li><a href="#HttpRequest_setPutData">HttpRequest::setPutData()</a></li>
+<li><a href="#HttpRequest_addPutData">HttpRequest::addPutData()</a></li>
+<li><a href="#HttpRequest_getPutData">HttpRequest::getPutData()</a></li>
 <li><a href="#HttpRequest_getResponseData">HttpRequest::getResponseData()</a></li>
 <li><a href="#HttpRequest_getResponseHeader">HttpRequest::getResponseHeader()</a></li>
 <li><a href="#HttpRequest_getResponseCookies">HttpRequest::getResponseCookies()</a></li>
@@ -1358,7 +1419,7 @@ http.cache_log is set.</p>
 </li>
 </ul>
 </div>
-    <p><b>Generated at: Fri, 17 Feb 2006 17:34:44 +0100</b></p>
+    <p><b>Generated at: Sat, 22 Apr 2006 23:03:59 +0200</b></p>
 </body>
 </html>