OSS\Http\RequestCore::set_method PHP Method

set_method() public method

Set the method type for the request.
public set_method ( string $method )
$method string (Required) One of the following constants: , , , , .
    public function set_method($method)
    {
        $this->method = strtoupper($method);
        return $this;
    }

Usage Example

Example #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_method