OSS\Http\RequestCore::set_body PHP Method

set_body() public method

Set the body to send in the request.
public set_body ( string $body )
$body string (Required) The textual content to send along in the body of the request.
    public function set_body($body)
    {
        $this->request_body = $body;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testExceptionGet()
 {
     $httpCore = null;
     $exception = false;
     try {
         $httpCore = new RequestCore("http://www.notexistsitexx.com");
         $httpCore->set_body("");
         $httpCore->set_method("GET");
         $httpCore->connect_timeout = 10;
         $httpCore->timeout = 10;
         $res = $httpCore->send_request();
     } catch (RequestCore_Exception $e) {
         $exception = true;
     }
     $this->assertTrue($exception);
 }
All Usage Examples Of OSS\Http\RequestCore::set_body