Exemplo n.º 1
0
 public function testPost()
 {
     $response = Client::post('baidu.com', NULL);
     $this->assertEquals($response->statusCode, 405);
     $this->assertNotNull($response->body);
 }
Exemplo n.º 2
0
 /**
  * 根据任务ID删除任务
  *
  * @param $taskID
  * @return \Hoge\Http\Response
  */
 public static function DeleteTask($taskID)
 {
     $request_url = self::TRANSCODER_API_HOST . self::URI_DELETE_TASK;
     $xml = new \DOMDocument('1.0', 'UTF-8');
     $xmlRoot = $xml->createElement('DeleteTaskRequest');
     $xmlRoot->appendChild($xml->createElement('TaskID', $taskID));
     $xml->appendChild($xmlRoot);
     $request_body = $xml->saveXML();
     $request_headers = array('Content-type' => 'text/xml');
     return Client::post($request_url, $request_body, $request_headers);
 }