PHP Класс Imdb\Request

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $url, Config $config ) No need to call this.
addHeaderLine ( $name, $value )
getLastResponseHeaders ( )
getRedirect ( ) : string | null Get the URL to redirect to if a 30* was returned
getResponseBody ( ) : string Get the Response body
getStatus ( ) : integer | null HTTP status code of the last response
getresponseheader ( string $header ) : string Get a header value from the response
sendRequest ( ) : boolean Send a request to the movie site
setURL ( string $url ) Set the URL we need to parse

Приватные методы

Метод Описание
callback_CURLOPT_HEADERFUNCTION ( $ch, $str )

Описание методов

__construct() публичный Метод

No need to call this.
public __construct ( string $url, Config $config )
$url string URL to open
$config Config The Config object to use

addHeaderLine() публичный Метод

public addHeaderLine ( $name, $value )

getLastResponseHeaders() публичный Метод

getRedirect() публичный Метод

Get the URL to redirect to if a 30* was returned
public getRedirect ( ) : string | null
Результат string | null URL to redirect to if 300, otherwise null

getResponseBody() публичный Метод

Get the Response body
public getResponseBody ( ) : string
Результат string page

getStatus() публичный Метод

HTTP status code of the last response
public getStatus ( ) : integer | null
Результат integer | null null if last request failed

getresponseheader() публичный Метод

Get a header value from the response
public getresponseheader ( string $header ) : string
$header string header field name
Результат string header value

sendRequest() публичный Метод

Send a request to the movie site
public sendRequest ( ) : boolean
Результат boolean success

setURL() публичный Метод

Set the URL we need to parse
public setURL ( string $url )
$url string