request() public method

Returns the result from the remote server. The client sets the correct headers for Basic Auth into the $message transmitted to the inner client.
public request ( string $method, string $path, Message $message = null ) : Message
$method string
$path string
$message eZ\Publish\Core\REST\Common\Message
return eZ\Publish\Core\REST\Common\Message
 /**
  * Tests authentication with message
  */
 public function testAuthWithMessage()
 {
     $innerClientMock = $this->getInnerHttpClientMock();
     $client = new BasicAuth($innerClientMock, 'sindelfingen', 's3cr3t');
     $innerClientMock->expects($this->once())->method('request')->with('PUT', '/some/path', new Message(array('X-Some-Header' => 'foobar', 'Authorization' => 'Basic c2luZGVsZmluZ2VuOnMzY3IzdA=='), 'body content'))->will($this->returnValue(new \stdClass()));
     $result = $client->request('PUT', '/some/path', new Message(array('X-Some-Header' => 'foobar'), 'body content'));
     $this->assertInstanceOf('\\stdClass', $result);
 }