PHP Class VCR\Request

Inheritance: extends Guzzle\Http\Message\EntityEnclosingRequest
Afficher le fichier Open project: php-vcr/php-vcr Class Usage Examples

Protected Properties

Свойство Type Description
$body string
$curlOptions array
$headers array
$method string
$postFields array
$postFiles array
$url string

Méthodes publiques

Méthode Description
__construct ( string $method, string $url, array $headers = [] )
addPostFile ( array $file )
fromArray ( array $request ) : Request Creates a new Request from a specified array.
getBody ( ) : string
getCurlOption ( $key ) : mixed
getCurlOptions ( ) : array
getHeader ( $key ) : mixed
getHeaders ( ) : array
getHost ( ) : mixed
getMethod ( ) : string
getPath ( ) : mixed
getPostFields ( ) : array
getPostFiles ( ) : array
getQuery ( ) : mixed
getUrl ( ) : string
matches ( Request $request, array $requestMatchers ) : boolean Returns true if specified request matches the current one with specified request matcher callbacks.
removeHeader ( $key )
setAuthorization ( string $username, string $password ) Sets the authorization credentials as header.
setBody ( string $body )
setCurlOption ( $key, $value )
setCurlOptions ( array $curlOptions )
setHeader ( $key, $value )
setMethod ( string $method ) Sets the request method.
setPostField ( $key, $value )
setPostFields ( array $post_fields )
setPostFiles ( array $post_files )
setUrl ( string $url )
toArray ( ) : array Returns an array representation of this request.

Method Details

__construct() public méthode

public __construct ( string $method, string $url, array $headers = [] )
$method string
$url string
$headers array

addPostFile() public méthode

public addPostFile ( array $file )
$file array

fromArray() public static méthode

Creates a new Request from a specified array.
public static fromArray ( array $request ) : Request
$request array Request represented as an array.
Résultat Request A new Request from specified array.

getBody() public méthode

public getBody ( ) : string
Résultat string

getCurlOption() public méthode

public getCurlOption ( $key ) : mixed
$key
Résultat mixed

getCurlOptions() public méthode

public getCurlOptions ( ) : array
Résultat array

getHeader() public méthode

public getHeader ( $key ) : mixed
$key
Résultat mixed

getHeaders() public méthode

public getHeaders ( ) : array
Résultat array

getHost() public méthode

public getHost ( ) : mixed
Résultat mixed

getMethod() public méthode

public getMethod ( ) : string
Résultat string

getPath() public méthode

public getPath ( ) : mixed
Résultat mixed

getPostFields() public méthode

public getPostFields ( ) : array
Résultat array

getPostFiles() public méthode

public getPostFiles ( ) : array
Résultat array

getQuery() public méthode

public getQuery ( ) : mixed
Résultat mixed

getUrl() public méthode

public getUrl ( ) : string
Résultat string

matches() public méthode

Returns true if specified request matches the current one with specified request matcher callbacks.
public matches ( Request $request, array $requestMatchers ) : boolean
$request Request Request to check if it matches the current one.
$requestMatchers array Request matcher callbacks.
Résultat boolean True if specified request matches the current one.

removeHeader() public méthode

public removeHeader ( $key )
$key

setAuthorization() public méthode

Sets the authorization credentials as header.
public setAuthorization ( string $username, string $password )
$username string Username.
$password string Password.

setBody() public méthode

public setBody ( string $body )
$body string

setCurlOption() public méthode

public setCurlOption ( $key, $value )
$key
$value

setCurlOptions() public méthode

public setCurlOptions ( array $curlOptions )
$curlOptions array

setHeader() public méthode

public setHeader ( $key, $value )
$key
$value

setMethod() public méthode

Sets the request method.
public setMethod ( string $method )
$method string HTTP request method like GET, POST, PUT, ...

setPostField() public méthode

public setPostField ( $key, $value )
$key
$value

setPostFields() public méthode

public setPostFields ( array $post_fields )
$post_fields array

setPostFiles() public méthode

public setPostFiles ( array $post_files )
$post_files array

setUrl() public méthode

public setUrl ( string $url )
$url string

toArray() public méthode

Returns an array representation of this request.
public toArray ( ) : array
Résultat array Array representation of this request.

Property Details

$body protected_oe property

protected string $body
Résultat string

$curlOptions protected_oe property

protected array $curlOptions
Résultat array

$headers protected_oe property

protected array $headers
Résultat array

$method protected_oe property

protected string $method
Résultat string

$postFields protected_oe property

protected array $postFields
Résultat array

$postFiles protected_oe property

protected array $postFiles
Résultat array

$url protected_oe property

protected string $url
Résultat string