## Properties:
-* array $options = NULL
- Options for this request, which override client options.
+* protected $options = NULL
+ Array of options for this request, which override client options.
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
## Returns:
* http\Client\Request, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadQueryStringException
## Returns:
* http\Client\Request, self.
+
+## Throws:
+
+* http\Client\InvalidArgumentException
* http\Client\Request, self.
-## Warnings:
+## Throws:
-* HTTP_E_INVALID_PARAM, if $content_type does not follow the general "primary/secondary" notation.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
* http\Client\Request, self.
+## Throws:
+
+* http\Client\InvalidArgumentException
* http\Client\Request, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadQueryStringException
+
## Example:
<?php
## Returns:
* http\Client\Request, self.
+
+## Throws:
+
+* http\Client\InvalidArgumentException
* array, list of http\Cookie instances.
-
## Example:
<?php
## Returns:
-* array, all transfer info if $name was not given.
+* object, stdClass instance with all transfer info if $name was not given.
* mixed, the specific transfer info for $name.
-* false, if the request was not complete or $name was not found.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
+* http\Exception\UnexpectedValueException
# Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
+* http\Exception\RuntimeException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exceptionc\InvalidArgumentException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
+* http\Exception\RuntimeException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
* http\Client, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
+* http\Exception\RuntimeException
## Example:
* http\Message, the request/response message chain representing the client's history.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+
## Example:
<?php
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
## Returns:
* http\Client\Response, the stored response for the request, or the last that was received.
-* NULL, if no response was found.
+* NULL, if no more response was available to pop, when no $request was given.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
* http\Client, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
+
## Example:
<?php
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
* http\Client, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Client, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
-# class http\Cookie extends http\Object
+# class http\Cookie
-A class representing a lisdt of cookies with specific attributes.
+A class representing a list of cookies with specific attributes.
## Constants:
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
## Example:
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Cookie, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
-# abstract class http\Encoding\Stream extends http\Object
+# abstract class http\Encoding\Stream
Base class for encoding stream implementations.
-# static string http\Encoding\Stream\Dechunk::decode(string $data)
+# static string http\Encoding\Stream\Dechunk::decode(string $data[, int &$decoded_len = 0])
Decode chunked encoded data.
* string $data
The data to decode.
+* Optional reference int $decoded_len = 0
+ Out parameter with the length of $data that's been decoded.
+ Should be ```strlen($data)``` if not truncated.
## Returns:
* string, the decoded data.
+* string, the unencoded data.
+* string, the truncated decoded data.
+* false, if $data cannot be decoded.
+
+## Notices:
+
+* If $data does not seem to be chunked encoded.
+
+## Warnings:
+
+* If $data cannot be decoded or is truncated.
## Returns:
* string, the compressed data.
+## Warnings:
+
+* If $data cannot be encoded.
## Returns:
* string, the uncompressed data.
+
+## Warnings:
+
+* If $data cannot be decoded.
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
## Returns:
* string, any pending data.
+
+## Warnings:
+
+* If the encoding stream is in an invalid state.
## Returns:
* string, any pending data.
+
+## Warnings:
+
+* If the encoding stream is in an invalid state.
## Returns:
* string, processed data.
+
+## Warnings:
+
+* If the encoding stream is in an invalid state.
-# class http\Env extends http\Object
+# class http\Env
The http\Env class provides static methods to manipulate and inspect the server's current request's HTTP environment.
None.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
## Returns:
* http\Env\Response, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
* http\Env\Response, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+
## Example:
<?php ob_end_Clean();chdir(__DIR__."/../../..");
## Returns:
* http\Env\Response, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Env\Response, self.
+
+## Throws:
+
+* http\Env\InvalidArgumentException
* http\Env\Response, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+
## Example:
<?php
## Returns:
* http\Env\Response, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Env\Response, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
-# class http\Exception extends Exception
+# interface http\Exception
-The http extension's Exception.
+The http extension's Exception interface.
-## Constants:
+Use it to catch any Exception thrown by pecl/http.
-* E_UNKNOWN
-* E_RUNTIME
-* E_INVALID_PARAM
-* E_HEADER
-* E_MALFORMED_HEADERS
-* E_MESSAGE
-* E_MESSAGE_TYPE
-* E_MESSAGE_BODY
-* E_ENCODING
-* E_CLIENT
-* E_CLIENT_POOL
-* E_CLIENT_DATASHARE
-* E_SOCKET
-* E_RESPONSE
-* E_URL
-* E_QUERYSTRING
-* E_COOKIE
+The individual exception classes extend their equally named native PHP extensions, if such exist, and implement this empty interface. For example the http\Exception\BadMethodCallException extends SPL's BadMethodCallException.
## Properties:
None.
+
+## Example:
+
+ <?php
+ $req = new http\Env\Request;
+
+ try {
+ $messages = $req->splitMultipartBody();
+ } catch (http\Exception\BadMethodCallException $e) {
+ // doh, no multipart message
+ } catch (http\Exception\BadMessageException $e) {
+ // failure while parsing
+ } catch (http\Exception $e) {
+ // here we used the interface to catch any http\Exception
+ } catch (Exception $e) {
+ // catch any other exception (unlikely, though)
+ }
+ ?>
--- /dev/null
+# class http\Exception\BadConversionException extends DomainException implements http\Exception
+
+A bad conversion (e.g. character conversion) was encountered.
--- /dev/null
+# class http\Exception\BadHeaderException extends DomainException implements http\Exception
+
+A bad HTTP header was encountered.
--- /dev/null
+# class http\Exception\BadMessageException extends DomainException implements http\Exception
+
+A bad HTTP message was encountered.
--- /dev/null
+# class http\Exception\BadMethodCallException extends BadMethodCallException implements http\Exception
+
+A method was called on an object, which was in an invalid or unexpected state.
--- /dev/null
+# class http\Exception\BadQueryStringException extends DomainException implements http\Exception
+
+A bad querystring was encountered.
--- /dev/null
+# class http\Exception\BadUrlException extends DomainException implements http\Exception
+
+A bad HTTP URL was encountered.
--- /dev/null
+# class http\Exception\InvalidArgumentException extends InvalidArgumentException implements http\Exception
+
+One or more invalid arguments were passed to a method.
--- /dev/null
+# class http\Exception\RuntimeException extends RuntimeException implements http\Exception
+
+A generic runtime exception.
+
--- /dev/null
+# class http\Exception\UnexpectedValueException extends UnexpectedValueException implements http\Exception
+
+An unexpected value was encountered.
-# class http\Header extends http\Object implements Serializable
+# class http\Header implements Serializable
The http\Header class provides methods to manipulate, match, negotiate and serialize HTTP headers.
## Returns:
* array of parsed headers, where the elements are instances of $header_class if specified.
+* false, if parsing fails.
+
+## Warnings:
+
+* If the header parser fails.
* string $serialized
The serialized HTTP header (i.e. "Name: value")
+## Warnings:
+
+* If the header parser fails.
-# class http\Message extends http\Object implements Countable, Serializable, Iterator
+# class http\Message implements Countable, Serializable, Iterator
The message class builds the foundation for any request and response message.
See http\Client\Request and http\Client\Response, as well as http\Env\Request and http\Env\Response.
-# class http\Message\Body extends http\Object implements Serializable
+# class http\Message\Body implements Serializable
The message body, represented as a PHP (temporary) stream.
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Example:
* http\Message\Body, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
+
## Example:
<?php
* http\Message\Body, self.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
+
## Example:
<?php
* http\Message\Body, self.
-## Warnings:
+## Throws:
-* E_MESSAGE_BODY, if writing to the body fails.
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMessageException
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException.
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueEcxeption
## Warnings:
-* E_INVALID_PARAM, if $into_class is not a descendant of http\Header.
+* If $into_class is specified but is not a descendant of http\Header.
## Example:
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
## Example:
* string, the request method.
* false, if the message was not of type request.
-## Notices:
+## Warnings:
-* E_MESSAGE_TYPE, if the message is not of type request.
+* If the message is not of type request.
* string, the request URL; usually the path and the querystring.
* false, if the message was not of type request.
-## Notices:
+## Warnings:
-* E_MESSAGE_TYPE, if the message is not of type request.
+* If the message is not of type request.
* int, the response status code.
* false, if the message is not of type response.
-## Notices:
+## Warnings:
-* E_MESSAGE_TYPE, if the message is not of type response.
+* If the message is not of type response.
* string, the response status phrase.
* false, if the message is not of type response.
-## Notices:
+## Warnings:
-* E_MESSAGE_TYPE, if the message is not of type response.
+* If the message is not of type response.
## Throws:
-* http\Exception.
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Returns:
* http\Message, the other end of the message chain.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
## Returns:
* http\Message, self.
+
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\UnexpectedValueException
## Notices:
-* E_MALFORMED_HEADERS, if the version separator is non-standard.
+* If a non-standard version separator is encounted.
-## Warnings:
+## Throws:
-* E_MALFORMED_HEADERS, if the version could not be parsed.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadHeaderException
## Example:
* http\Message, self.
-## Warnings:
+## Throws:
-* E_MALFORMED_HEADERS, if the message information could not be parsed.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadHeaderException
## Format of the message info:
## Returns:
* http\Message, self.
-* false, if the message was not of type request.
-## Notices:
+## Throws:
-* E_MESSAGE_TYPE, if the message is not of type request.
-
-## Warnings:
-
-* E_INVALID_PARAM, if the method is of zero length.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
## Returns:
* http\Message, self.
-* false, if the message was not of type request.
-## Notices:
+## Throws:
-* E_MESSAGE_TYPE, if the message is not of type request.
-
-## Warnings:
-
-* E_INVALID_PARAM, if the url is of zero length.
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
## Example:
-# http\Message http\Message::setResponseCode(int $response_code)
+# http\Message http\Message::setResponseCode(int $response_code[, bool $strict = true])
Set the response status code.
See http\Message::getResponseCode() and http\Message::setResponseStatus().
+> **Note:** This method also resets the response status phrase to the default for that code.
+
## Params:
* int $response_code
The response code.
+* Optional bool $strict = true
+ Whether to check that the response code is between 100 and 599 inclusive.
## Returns:
* http\Message, self.
-* false, if the message is not of type response.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
## Returns:
* http\Message, self.
-* false, if the message is not of type response.
-## Notice:
-
-* E_MESSAGE_TYPE, if the message is not of type response.
+## Throws:
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
## Example:
* http\Message, a message chain of all messages of the multipart body.
+## Throws:
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadMethodCallException
+* http\Exception\BadMessageException
+
## Example:
<?php
* string $data
The serialized message.
+## Errors:
+
+* If the message could not be unserialized.
+++ /dev/null
-# abstract class http\Object
-
-The http\Object class provides an error handling foundation for the rest of the http extension's framwework.
-
-## Constants:
-
-* EH_NORMAL
- Normal error handling.
-* EH_SUPPRESS
- Suppress errors.
-* EH_THROW
- Throw exceptions on errors.
-
-## Properties:
-
-* static protected $defaultErrorHandling = NULL
- Static default error handling.
-* protected $errorHandling = NULL
- Per instance error handling.
+++ /dev/null
-# static int http\Object::getDefaultErrorHandling()
-
-Retreive the http extension's global default error handling.
-
-## Returns:
-
-* int, the error handling. See http\Object::EH_* constants.
-* NULL, when error handling is not set.
+++ /dev/null
-# int http\Object::getErrorHandling()
-
-Retrieve the currently set instance error handling.
-
-## Params:
-
-None.
-
-## Returns:
-
-* int, the current error handling. See http\Object::EH_* constants.
-
+++ /dev/null
-# static void http\Object::setDefaultErrorHandling(int $eh)
-
-Set the http extension's global default error handling.
-
-## Params:
-
-* int $eh
- The error handling. See http\Object::EH_* constants.
-
-## Throws:
-
-* http\Exception
- When http\Object::EH_THROW is in effect.
-
-## Warnings:
-
-* E_RUNTIME, if $eh is an unknown error handling.
+++ /dev/null
-# http\Object http\Object::setErrorHandling(int $eh)
-
-Set instance error handling.
-
-## Params:
-
-* int $eh
- The error handling this instance should enforce.
-
-## Returns:
-
-* http/Object, self.
-
-## Throws:
-
-* http\Exception
- When http\Object::EH_THROW is in effect.
-
-## Warnings:
-
-* E_RUNTIME, if $eh is an unknown error handling code.
+++ /dev/null
-# void http\Object::triggerError(int $eh, int $code, string $error)
-
-Trigger an error with the specified error handling.
-
-## Params:
-
-* int $eh
- The error handling to use. See http\Object::EH_* constants.
-* int $code
- The error code.
-* string $error
- The error message.
-
-# class http\Params extends http\Object implements ArrayAccess
+# class http\Params implements ArrayAccess
Parse, interpret and compose HTTP (header) parameters.
* DEF_VAL_SEP
The default value separator ("=").
* COOKIE_PARAM_SEP
- TBD
+ Empty param separator to parse cookies.
* PARSE_RAW
Do not interpret the parsed parameters.
* PARSE_DEFAULT
## Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* http\Exception\RuntimeException
-# class http\QueryString extends http\Object implements Serializable, ArrayAccess, IteratorAggregate
+# class http\QueryString implements Serializable, ArrayAccess, IteratorAggregate
The http\QueryString class provides versatile facilities to retrieve, use and manipulate query strings and form data.
## Throws:
-* http\Exception
+* http\Exception\BadQueryStringException
## Example:
## Throws:
-* http\Exception
+* http\Exception\UnexpectedValueException
## Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* InvalidArgumentException
Set additional $params to a clone of this instance.
See http\QueryString::set().
-> **Note:** This method returns a clone (copy) of this instance
+> **Note:** This method returns a clone (copy) of this instance.
## Params:
* mixed $params = NULL
Additional params as object, array or string to parse.
-
## Returns:
* http\QueryString, clone.
+
+## Throws:
+
+* http\Exception\BadQueryStringException
## Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* http\Exception\BadConversionException
-# class http\Url extends http\Object
+# class http\Url
The http\Url class provides versatile means to parse, construct and manipulate URLs.
## Throws:
-* http\Exception
+* http\Exception\InvalidArgumentException
+* http\Exception\BadUrlException
## Returns:
* http\Url, clone.
+
+## Throws:
+
+
+* http\Exception\InvalidArgumentException
+* http\Exception\BadUrlException
case "stdClass":
case "Exception":
case "ErrorException":
+ case "RuntimeException":
+ case "UnexpectedValueException":
+ case "DomainException":
+ case "InvalidArgumentException":
+ case "BadMethodCallException":
case "Closure":
case "Generator":
case "Countable":