Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : HTTP : Constants

Constants

predefined http module constants ()

Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

Constants usable with http_support()

HTTP_SUPPORT (integer)
querying for this constant will always return TRUE
HTTP_SUPPORT_REQUESTS (integer)
whether support to issue HTTP requests is given, ie. libcurl support was compiled in
HTTP_SUPPORT_MAGICMIME (integer)
whether support to guess the Content-Type of HTTP messages is given, ie. libmagic support was compiled in
HTTP_SUPPORT_ENCODINGS (integer)
whether support for zlib encodings is given, ie. libz support was compiled in
HTTP_SUPPORT_SSLREQUESTS (integer)
whether support to issue HTTP requests over SSL is givem, ie. linked libcurl was built with SSL support

Constants usable with http_parse_params()

HTTP_PARAMS_ALLOW_COMMA (integer)
allow commans additionally to semicolons as separator
HTTP_PARAMS_ALLOW_FAILURE (integer)
continue parsing after an error occurred
HTTP_PARAMS_RAISE_ERROR (integer)
raise PHP warnings on parse errors
HTTP_PARAMS_DEFAULT (integer)
all three values above, bitwise or'ed

Constants usable with http_parse_cookie() and its return value

HTTP_COOKIE_PARSE_RAW (integer)
don't urldecode values
HTTP_COOKIE_SECURE (integer)
whether "secure" was found in the cookie's parameters list
HTTP_COOKIE_HTTPONLY (integer)
whether "httpOnly" was found in the cookie's parameter list

Constants usable with http_deflate() and HttpDeflateStream

HTTP_DEFLATE_LEVEL_DEF (integer)
HTTP_DEFLATE_LEVEL_MIN (integer)
HTTP_DEFLATE_LEVEL_MAX (integer)
HTTP_DEFLATE_TYPE_ZLIB (integer)
HTTP_DEFLATE_TYPE_GZIP (integer)
HTTP_DEFLATE_TYPE_RAW (integer)
HTTP_DEFLATE_STRATEGY_DEF (integer)
HTTP_DEFLATE_STRATEGY_FILT (integer)
HTTP_DEFLATE_STRATEGY_HUFF (integer)
HTTP_DEFLATE_STRATEGY_RLE (integer)
HTTP_DEFLATE_STRATEGY_FIXED (integer)

Constants usable with HttpDeflateStream and HttpInflateStream

HTTP_ENCODING_STREAM_FLUSH_NONE (integer)
don't flush
HTTP_ENCODING_STREAM_FLUSH_SYNC (integer)
synchronized flush only
HTTP_ENCODING_STREAM_FLUSH_FULL (integer)
full data flush

Constants used for error reporting and Exceptions

HTTP_E_RUNTIME (integer)
runtime error
HTTP_E_INVALID_PARAM (integer)
an invalid parameter was passed
HTTP_E_HEADER (integer)
header() or similar operation failed
HTTP_E_MALFORMED_HEADERS (integer)
HTTP header parse error
HTTP_E_REQUEST_METHOD (integer)
unknown/invalid request method
HTTP_E_MESSAGE_TYPE (integer)
with operation incompatible message type
HTTP_E_ENCODING (integer)
encoding/decoding error
HTTP_E_REQUEST (integer)
request failure
HTTP_E_REQUEST_POOL (integer)
request pool failure
HTTP_E_SOCKET (integer)
socket exception
HTTP_E_RESPONSE (integer)
response failure
HTTP_E_URL (integer)
invalid URL
HTTP_E_QUERYSTRING (integer)
querystring operation failure

Constants usable with HttpMessage

HTTP_MSG_NONE (integer)
the message is of no specific type
HTTP_MSG_REQUEST (integer)
request style message
HTTP_MSG_RESPONSE (integer)
response style message

Constants usable with HttpQueryString

HTTP_QUERYSTRING_TYPE_BOOL (integer)
HTTP_QUERYSTRING_TYPE_INT (integer)
HTTP_QUERYSTRING_TYPE_FLOAT (integer)
HTTP_QUERYSTRING_TYPE_STRING (integer)
HTTP_QUERYSTRING_TYPE_ARRAY (integer)
HTTP_QUERYSTRING_TYPE_OBJECT (integer)

Constants used for the httpauthtype request option

HTTP_AUTH_BASIC (integer)
use "basic" authentication
HTTP_AUTH_DIGEST (integer)
use "digest" authentication
HTTP_AUTH_NTLM (integer)
use "NTLM" authentication
HTTP_AUTH_GSSNEG (integer)
use "GSS-NEGOTIATE" authentication
HTTP_AUTH_ANY (integer)
try any authentication scheme

Constants used for the HTTP protocol version request option

HTTP_VERSION_ANY (integer)
no specific HTTP protocol version
HTTP_VERSION_1_0 (integer)
HTTP version 1.0
HTTP_VERSION_1_1 (integer)
HTTP version 1.1

Constants used for the SSL protocol type and version request option

HTTP_SSL_VERSION_ANY (integer)
no specific SSL protocol version
HTTP_SSL_VERSION_TLSv1 (integer)
use TLSv1 only
HTTP_SSL_VERSION_SSLv3 (integer)
use SSLv3 only
HTTP_SSL_VERSION_SSLv2 (integer)
use SSLv2 only

Constants used for the proxytype request option

HTTP_PROXY_SOCKS4 (integer)
the proxy is a SOCKS4 type proxy
HTTP_PROXY_SOCKS5 (integer)
the proxy is a SOCKS5 type proxy
HTTP_PROXY_HTTP (integer)
standard HTTP proxy

Constants used for the ipresolve request option

HTTP_IPRESOLVE_V4 (integer)
use IPv4 only for name lookups
HTTP_IPRESOLVE_V6 (integer)
use IPv6 only for name lookups
HTTP_IPRESOLVE_ANY (integer)
use any IP mechanism only for name lookups

Predefined HTTP request method constants

HTTP_METH_GET (integer)
HTTP_METH_HEAD (integer)
HTTP_METH_POST (integer)
HTTP_METH_PUT (integer)
HTTP_METH_DELETE (integer)
HTTP_METH_OPTIONS (integer)
HTTP_METH_TRACE (integer)
HTTP_METH_CONNECT (integer)
HTTP_METH_PROPFIND (integer)
HTTP_METH_PROPPATCH (integer)
HTTP_METH_MKCOL (integer)
HTTP_METH_COPY (integer)
HTTP_METH_MOVE (integer)
HTTP_METH_LOCK (integer)
HTTP_METH_UNLOCK (integer)
HTTP_METH_VERSION_CONTROL (integer)
HTTP_METH_REPORT (integer)
HTTP_METH_CHECKOUT (integer)
HTTP_METH_CHECKIN (integer)
HTTP_METH_UNCHECKOUT (integer)
HTTP_METH_MKWORKSPACE (integer)
HTTP_METH_UPDATE (integer)
HTTP_METH_LABEL (integer)
HTTP_METH_MERGE (integer)
HTTP_METH_BASELINE_CONTROL (integer)
HTTP_METH_MKACTIVITY (integer)
HTTP_METH_ACL (integer)

Constants usable with http_redirect()

HTTP_REDIRECT (integer)
guess applicable redirect method
HTTP_REDIRECT_PERM (integer)
permanent redirect (301 Moved permanently)
HTTP_REDIRECT_FOUND (integer)

standard redirect (302 Found)

Note:

RFC 1945 and RFC 2068 specify that the client is not allowed to change the method on the redirected request. However, most existing user agent implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original request method. The status codes 303 and 307 have been added for servers that wish to make unambiguously clear which kind of reaction is expected of the client.

HTTP_REDIRECT_POST (integer)
redirect applicable to POST requests (303 See other)
HTTP_REDIRECT_PROXY (integer)
proxy redirect (305 Use proxy)
HTTP_REDIRECT_TEMP (integer)
temporary redirect (307 Temporary Redirect)

Constants usable with http_build_url()

HTTP_URL_REPLACE (integer)
replace every part of the first URL when there's one of the second URL
HTTP_URL_JOIN_PATH (integer)
join relative paths
HTTP_URL_JOIN_QUERY (integer)
join query strings
HTTP_URL_STRIP_USER (integer)
strip any user authentication information
HTTP_URL_STRIP_PASS (integer)
strip any password authentication information
HTTP_URL_STRIP_AUTH (integer)
strip any authentication information
HTTP_URL_STRIP_PORT (integer)
strip explicit port numbers
HTTP_URL_STRIP_PATH (integer)
strip complete path
HTTP_URL_STRIP_QUERY (integer)
strip query string
HTTP_URL_STRIP_FRAGMENT (integer)
strip any fragments (#identifier)
HTTP_URL_STRIP_ALL (integer)
strip anything but scheme and host

Related Examples ( Source code ) » http.constants



Change Language


Follow Navioo On Twitter
Installation
Configuration
Resources
Constants
Request Options
HttpMessage
HttpMessage::__construct
HttpMessage::factory
HttpMessage::fromEnv
HttpMessage::fromString
HttpMessage::toString
HttpMessage::toMessageTypeObject
HttpMessage::guessContentType
HttpMessage::detach
HttpMessage::prepend
HttpMessage::reverse
HttpMessage::send
HttpMessage::getParentMessage
HttpMessage::getType
HttpMessage::setType
HttpMessage::getHttpVersion
HttpMessage::setHttpVersion
HttpMessage::getHeaders
HttpMessage::getHeader
HttpMessage::addHeaders
HttpMessage::setHeaders
HttpMessage::getBody
HttpMessage::setBody
HttpMessage::getRequestMethod
HttpMessage::setRequestMethod
HttpMessage::getRequestUrl
HttpMessage::setRequestUrl
HttpMessage::getResponseCode
HttpMessage::setResponseCode
HttpMessage::getResponseStatus
HttpMessage::setResponseStatus
HttpQueryString
HttpQueryString::__construct
HttpQueryString::singleton
HttpQueryString::get
HttpQueryString::mod
HttpQueryString::set
HttpQueryString::toArray
HttpQueryString::toString
HttpQueryString::xlate
HttpDeflateStream
HttpDeflateStream::factory
HttpDeflateStream::__construct
HttpDeflateStream::update
HttpDeflateStream::flush
HttpDeflateStream::finish
HttpInflateStream
HttpInflateStream::factory
HttpInflateStream::__construct
HttpInflateStream::update
HttpInflateStream::flush
HttpInflateStream::finish
HttpRequest
HttpRequest::addCookies
HttpRequest::addHeaders
HttpRequest::addPostFields
HttpRequest::addPostFile
HttpRequest::addPutData
HttpRequest::addQueryData
HttpRequest::addRawPostData
HttpRequest::addSslOptions
HttpRequest::clearHistory
HttpRequest::__construct
HttpRequest::enableCookies
HttpRequest::getContentType
HttpRequest::getCookies
HttpRequest::getHeaders
HttpRequest::getHistory
HttpRequest::getMethod
HttpRequest::getOptions
HttpRequest::getPostFields
HttpRequest::getPostFiles
HttpRequest::getPutData
HttpRequest::getPutFile
HttpRequest::getQueryData
HttpRequest::getRawPostData
HttpRequest::getRawRequestMessage
HttpRequest::getRawResponseMessage
HttpRequest::getRequestMessage
HttpRequest::getResponseBody
HttpRequest::getResponseCode
HttpRequest::getResponseCookies
HttpRequest::getResponseData
HttpRequest::getResponseHeader
HttpRequest::getResponseInfo
HttpRequest::getResponseMessage
HttpRequest::getResponseStatus
HttpRequest::getSslOptions
HttpRequest::getUrl
HttpRequest::resetCookies
HttpRequest::send
HttpRequest::setContentType
HttpRequest::setCookies
HttpRequest::setHeaders
HttpRequest::setMethod
HttpRequest::setOptions
HttpRequest::setPostFields
HttpRequest::setPostFiles
HttpRequest::setPutData
HttpRequest::setPutFile
HttpRequest::setQueryData
HttpRequest::setRawPostData
HttpRequest::setSslOptions
HttpRequest::setUrl
HttpRequestPool
HttpRequestPool::attach
HttpRequestPool::__construct
HttpRequestPool::__destruct
HttpRequestPool::detach
HttpRequestPool::getAttachedRequests
HttpRequestPool::getFinishedRequests
HttpRequestPool::reset
HttpRequestPool::send
HttpRequestPool::socketPerform
HttpRequestPool::socketSelect
HttpResponse
HttpResponse::capture
HttpResponse::getBufferSize
HttpResponse::getCacheControl
HttpResponse::getCache
HttpResponse::getContentDisposition
HttpResponse::getContentType
HttpResponse::getData
HttpResponse::getETag
HttpResponse::getFile
HttpResponse::getGzip
HttpResponse::getHeader
HttpResponse::getLastModified
HttpResponse::getStream
HttpResponse::getThrottleDelay
HttpResponse::getRequestBody
HttpResponse::getRequestBodyStream
HttpResponse::getRequestHeaders
HttpResponse::guessContentType
HttpResponse::redirect
HttpResponse::send
HttpResponse::setBufferSize
HttpResponse::setCacheControl
HttpResponse::setCache
HttpResponse::setContentDisposition
HttpResponse::setContentType
HttpResponse::setData
HttpResponse::setETag
HttpResponse::setFile
HttpResponse::setGzip
HttpResponse::setHeader
HttpResponse::setLastModified
HttpResponse::setStream
HttpResponse::setThrottleDelay
HttpResponse::status
http_cache_etag
http_cache_last_modified
http_chunked_decode
http_deflate
http_inflate
http_get_request_body_stream
http_get_request_body
http_get_request_headers
http_date
http_support
http_match_etag
http_match_modified
http_match_request_header
http_build_cookie
http_negotiate_charset
http_negotiate_content_type
http_negotiate_language
ob_deflatehandler
ob_etaghandler
ob_inflatehandler
http_parse_cookie
http_parse_headers
http_parse_message
http_parse_params
http_persistent_handles_count
http_persistent_handles_ident
http_persistent_handles_clean
http_get
http_head
http_post_data
http_post_fields
http_put_data
http_put_file
http_put_stream
http_request_method_exists
http_request_method_name
http_request_method_register
http_request_method_unregister
http_request
http_request_body_encode
http_redirect
http_send_content_disposition
http_send_content_type
http_send_data
http_send_file
http_send_last_modified
http_send_status
http_send_stream
http_throttle
http_build_str
http_build_url
eXTReMe Tracker