Example #1
0
 public function testPutRequest()
 {
     $curl = new Curl();
     $curl->setMethod('PUT');
     $curl->setOption(CURLOPT_URL, 'http://httpbin.org/put');
     $curl->setPutString(json_encode(['foo' => 23, 'bar' => 42]));
     $response = $curl->execute();
     $data = json_decode($response);
     $this->assertEquals(['foo' => 23, 'bar' => 42], (array) json_decode($data->data));
 }