PHP Class Clue\React\Buzz\Browser

Show file Open project: clue/buzz-react Class Usage Examples

Public Methods

Method Description
__construct ( React\EventLoop\LoopInterface $loop, Sender $sender = null, MessageFactory $messageFactory = null )
delete ( $url, $headers = [], $content = '' )
get ( $url, $headers = [] )
head ( $url, $headers = [] )
patch ( $url, $headers = [], $content = '' )
post ( $url, $headers = [], $content = '' )
put ( $url, $headers = [], $content = '' )
send ( Psr\Http\Message\RequestInterface $request )
submit ( $url, array $fields, $headers = [], $method = 'POST' )
withBase ( string | Psr\Http\Message\UriInterface $baseUri ) : self Creates a new Browser instance with the given absolute base URI
withOptions ( array $options )
withSender ( Sender $sender )
withoutBase ( ) : self Creates a new Browser instance *without* a base URL

Method Details

__construct() public method

public __construct ( React\EventLoop\LoopInterface $loop, Sender $sender = null, MessageFactory $messageFactory = null )
$loop React\EventLoop\LoopInterface
$sender Clue\React\Buzz\Io\Sender
$messageFactory Clue\React\Buzz\Message\MessageFactory

delete() public method

public delete ( $url, $headers = [], $content = '' )

get() public method

public get ( $url, $headers = [] )

head() public method

public head ( $url, $headers = [] )

patch() public method

public patch ( $url, $headers = [], $content = '' )

post() public method

public post ( $url, $headers = [], $content = '' )

put() public method

public put ( $url, $headers = [], $content = '' )

send() public method

public send ( Psr\Http\Message\RequestInterface $request )
$request Psr\Http\Message\RequestInterface

submit() public method

public submit ( $url, array $fields, $headers = [], $method = 'POST' )
$fields array

withBase() public method

This is mostly useful for using (RESTful) HTTP APIs. Any relative URI passed to any of the request methods will simply be appended behind the given $baseUri. By definition of this library, a given base URI MUST always absolute and can not contain any placeholders.
See also: self::withoutBase()
public withBase ( string | Psr\Http\Message\UriInterface $baseUri ) : self
$baseUri string | Psr\Http\Message\UriInterface absolute base URI
return self

withOptions() public method

public withOptions ( array $options )
$options array

withSender() public method

public withSender ( Sender $sender )
$sender Clue\React\Buzz\Io\Sender

withoutBase() public method

Creates a new Browser instance *without* a base URL
See also: self::withBase()
public withoutBase ( ) : self
return self