예제 #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
 }