/** @test */ public function toStringUsesUserPassFromURL() { $requestData = new RequestData('GET', 'http://*****:*****@www.example.com'); $expected = "GET / HTTP/1.0\r\n" . "Host: www.example.com\r\n" . "User-Agent: React/alpha\r\n" . "Authorization: Basic am9objpkdW1teQ==\r\n" . "\r\n"; $this->assertSame($expected, $requestData->__toString()); }
public function request($method, $url, array $headers = [], $protocolVersion = '1.0') { $requestData = new RequestData($method, $url, $headers, $protocolVersion); $connector = $this->getConnectorForScheme($requestData->getScheme()); return new Request($connector, $requestData); }
public function request($method, $url, array $headers = array()) { $requestData = new RequestData($method, $url, $headers); $connectionManager = $this->getConnectorForScheme($requestData->getScheme()); return new Request($this->loop, $connectionManager, $requestData); }