URLConnection¶
-
php\net\URLConnection Class URLConnection
Properties
- property
doOutput¶
bool
- property
doInput¶
bool
- property
requestMethod¶
stringPOST, GET, PUT, etc.
- property
connectTimeout¶
php\net\int millisthat specifies the connect timeout value in milliseconds
- property
readTimeout¶
php\net\int millisthe read timeout to a specified timeout, in milliseconds.
- property
useCaches¶
bool
- property
ifModifiedSince¶
php\net\int millis
- property
followRedirects¶
bool
- property
url¶read-only
- property
responseCode¶
intread-only
- property
responseMessage¶
intread-only
- property
contentLength¶
php\net\int bytesread-only
int the content length of the resource that this connection’s URL references, -1 if the content length is not known, or if the content length is greater than Integer.MAX_VALUE.
- property
contentType¶
stringread-only
- property
contentEncoding¶
stringread-only
- property
expiration¶
intread-only
- property
lastModified¶
intread-only
- property
usingProxy¶
boolread-only
Methods
__construct($parent)¶protected
Параметры:
- $parent – php\net\URLConnection
connect()¶
getHeaderField($name)¶
Параметры:
- $name –
string
getHeaderFields()¶
Результат: array
getInputStream()¶
Результат: php\io\Stream
getErrorStream()¶
Результат: php\io\Stream
getOutputStream()¶
Результат: php\io\Stream
setRequestProperty($name, $value)¶
Параметры:
- $name –
string- $value –
string
getRequestProperty($name)¶
Параметры:
- $name –
string
getRequestProperties()¶
Результат: array
disconnect()¶
setChunkedStreamingMode($chunklen)¶This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is <b>not</b> known in advance. In this mode, chunked transfer encoding is used to send the request body. Note, not all HTTP servers support this mode.
Параметры:
- $chunklen –
int- The number of bytes to write in each chunk.If chunklen is less than or equal to zero, a default value will be used.
- static
guessContentTypeFromStream($stream)¶Tries to determine the type of an input stream based on the characters at the beginning of the input stream. This method can be used by subclasses that override the <code>getContentType</code> method.
Параметры:
- $stream – php\io\Stream
Результат:
string
- static
guessContentTypeFromName($name)¶
Параметры:
- $name –
string
- static
create($url, $proxy = null)¶
Параметры:
- $url –
string- $proxy – php\net\Proxy
Результат: