X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=docs%2Ffunctions.html;h=0e53c616ce4ffb26a736e14107fef50907ba24d4;hp=fa3d1c5d301efc799c1db0f723f2d7195fc6d690;hb=ef227f4f7f697c954eef0adb9f9f897148a771ca;hpb=c986ec1a6abc7c4295d2fd9b666c106db17320ea diff --git a/docs/functions.html b/docs/functions.html index fa3d1c5..0e53c61 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -253,7 +253,15 @@ several consecutive HTTP messages.

Expects a string parameter containing HTTP headers.

Returns an array on success, or FALSE on failure.

Example:


-<?php
$headers 
"content-type: text/html; charset=UTF-8\r\n".
           
"Server: Funky/1.0\r\n".
           
"Set-Cookie: foo=bar\r\n".
           
"Set-Cookie: baz=quux\r\n".
           
"Folded: works\r\n\ttoo\r\n";
print_r(http_parse_headers($headers));

Array
(
    [
Content-Type] => text/htmlchatset=UTF-8
    
[Server] => Funky/1.0
    
[Set-Cookie] => Array
        (
            [
0] => foo=bar
            
[1] => baz=quux
        
)
    [
Folded] => works
        too 
?>

+<?php
$headers 
"content-type: text/html; charset=UTF-8\r\n".
           
"Server: Funky/1.0\r\n".
           
"Set-Cookie: foo=bar\r\n".
           
"Set-Cookie: baz=quux\r\n".
           
"Folded: works\r\n\ttoo\r\n";
print_r(http_parse_headers($headers));

Array
(
    [
Content-Type] => text/htmlchatset=UTF-8
    
[Server] => Funky/1.0
    
[Set-Cookie] => Array
        (
            [
0] => foo=bar
            
[1] => baz=quux
        
)
    [
Folded] => works
        too 

?>
+

+

+ +

Parses HTTP cookies like sent in a response into a struct.

+

Expects a string as parameter containing the value of a Set-Cookie response header.

+

Returns an stdClass object with the cookie params as properties on success or FALSE on failure.

+

Example:


+<?php
print_r
(http_parse_cookie("foo=bar; path=/"));

stdClass Object
(
    [
name] => foo
    
[value] => bar
    
[path] => /
)
?>

array http_get_request_headers(void)

@@ -350,7 +358,7 @@ See http_get() for a full list of available options.

Returns the request method name as string on success, or FALSE on failure.

string http_build_query(mixed formdata [, string prefix[, string arg_separator]])

Generates a form-encoded query string from an associative array or object.

-

string http_gzencode(string data[, int level = -1])

+

string http_gzencode(string data[, int level = -1[, int mtime = 0]])

Compress data with the HTTP compatible GZIP encoding.

Expects the first parameter to be a string which contains the data that
should be encoded. Additionally accepts an optional in paramter specifying
@@ -361,7 +369,7 @@ best compression ratio.

Uncompress data compressed with the HTTP compatible GZIP encoding.

Expects a string as parameter containing the compressed data.

Returns the decoded string on success, or NULL on failure.

-

string http_deflate(string data[, int level = -1])

+

string http_deflate(string data[, int level = -1[, bool zlib_header = false]])

Compress data with the HTTP compatible DEFLATE encoding.

Expects the first parameter to be a string containing the data that should
be encoded. Additionally accepts an optional int parameter specifying the
@@ -372,17 +380,6 @@ compression ratio.

Uncompress data compressed with the HTTP compatible DEFLATE encoding.

Expects a string as parameter containing the compressed data.

Returns the decoded string on success, or NULL on failure.

-

string http_compress(string data[, int level = -1])

-

Compress data with the HTTP compatible COMPRESS encoding.

-

Expects the first parameter to be a string containing the data which should
-be encoded. Additionally accepts an optional int parameter specifying the
-compression level, where -1 is default, 0 is no compression and 9 is best
-compression ratio.

-

Returns the encoded string on success, or NULL on failure.

-

string http_uncompress(string data)

-

Uncompress data compressed with the HTTP compatible COMPRESS encoding.

-

Expects a string as parameter containing the compressed data.

-

Returns the decoded string on success, or NULL on failure.

int http_support([int feature = 0])

Check for feature that require external libraries.

Accpepts an optional in parameter specifying which feature to probe for.
@@ -759,7 +756,7 @@ HttpMalformedHeaderException, HttpEncodingException.

Instantiate a new HttpRequestPool object. An HttpRequestPool is
able to send several HttpRequests in parallel.

WARNING: Don't attach/detach HttpRequest objects to the HttpRequestPool
-object while you're using the implemented Interator interface.

+object while you're using the implemented Iterator interface.

Accepts virtual infinite optional parameters each referencing an
HttpRequest object.

Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).

@@ -1022,6 +1019,8 @@ http.cache_log is set.

  • http_parse_headers
  • +
  • http_parse_cookie +
  • http_get_request_headers
  • http_get_request_body @@ -1058,10 +1057,6 @@ http.cache_log is set.

  • http_inflate
  • -
  • http_compress -
  • -
  • http_uncompress -
  • http_support
  • @@ -1200,7 +1195,7 @@ http.cache_log is set.

    -

    Generated at: Fri, 09 Dec 2005 13:56:42 +0100

    +

    Generated at: Wed, 14 Dec 2005 16:25:48 +0100