コード例 #1
0
ファイル: BasicClient.php プロジェクト: fliglio/web
 private function getBuilderCommon($url, array $headers = array())
 {
     $b = new BasicRequestBuilder();
     $b->url($url);
     foreach ($headers as $h) {
         $b->header($h);
     }
     return $b;
 }
コード例 #2
0
ファイル: ClientTest.php プロジェクト: fliglio/web
 public function testError()
 {
     $client = new BasicClient();
     $b = new BasicRequestBuilder();
     $req = $b->method(Http::METHOD_PUT)->url('http://www.google.com')->build();
     $resp = $client->makeRequest($req);
     $this->assertEquals($resp->getStatus(), 405);
     // method not allowed
 }