put() публичный Метод

Send PUT request.
public put ( string $path = null, array $data = [], array $options = [] ) : string
$path string
$data array
$options array
Результат string
Пример #1
0
 public function testPut()
 {
     $http = new Service($this->_testConfig);
     $http->put('update.xml', array('status' => 'cool'));
     $expected = join("\r\n", array('PUT /update.xml HTTP/1.1', 'Host: localhost:80', 'Connection: Close', 'User-Agent: Mozilla/5.0', 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: 11', '', 'status=cool'));
     $result = (string) $http->last->request;
     $this->assertEqual($expected, $result);
     $expected = join("\r\n", array('HTTP/1.1 200 OK', 'Host: localhost:80', 'Connection: Close', 'User-Agent: Mozilla/5.0', 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: 11', '', 'status=cool'));
     $result = (string) $http->last->response;
     $this->assertEqual($expected, $result);
 }