delete() public method

Send DELETE request.
public delete ( string $path = null, array $data = [], array $options = [] ) : string
$path string
$data array
$options array
return string
Example #1
0
 public function testDelete()
 {
     $http = new Service($this->_testConfig);
     $http->delete('posts/1');
     $expected = join("\r\n", array('DELETE /posts/1 HTTP/1.1', 'Host: localhost:80', 'Connection: Close', 'User-Agent: Mozilla/5.0', '', ''));
     $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', '', ''));
     $result = (string) $http->last->response;
     $this->assertEqual($expected, $result);
 }