示例#1
0
 private function getBuilderCommon($url, array $headers = array())
 {
     $b = new BasicRequestBuilder();
     $b->url($url);
     foreach ($headers as $h) {
         $b->header($h);
     }
     return $b;
 }
示例#2
0
 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
 }