src/HttpRequest.php
protected function setRequestMethod($method) {
    switch (strtoupper($method)) {
      case 'HEAD':
        curl_setopt($this->request, CURLOPT_NOBODY, true);
        break;
      case 'GET':
        # Hack to allow a request body to be set via CURLOPT_POSTFIELDS
        # for GET requests.
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, 'GET');
        break;
      case 'POST':
        curl_setopt($this->request, CURLOPT_POST, true);
        break;
      default:
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
    }
  }
protected function setRequestMethod($method) {
    switch (strtoupper($method)) {
      case 'HEAD':
        curl_setopt($this->request, CURLOPT_NOBODY, true);
        break;
      case 'GET':
        # Hack to allow a request body to be set via CURLOPT_POSTFIELDS
        # for GET requests.
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, 'GET');
        break;
      case 'POST':
        curl_setopt($this->request, CURLOPT_POST, true);
        break;
      default:
        curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
    }
  }
protected function setRequestMethod ( $ method ) { switch ( strtoupper ( $ method ) ) { case 'HEAD' : curl_setopt ( $ this -> request , CURLOPT_NOBODY , true ) ; break ; case 'GET' : # Hack to allow a request body to be set via CURLOPT_POSTFIELDS # for GET requests. curl_setopt ( $ this -> request , CURLOPT_CUSTOMREQUEST , 'GET' ) ; break ; case 'POST' : curl_setopt ( $ this -> request , CURLOPT_POST , true ) ; break ; default : curl_setopt ( $ this -> request , CURLOPT_CUSTOMREQUEST , $ method ) ; } }
Set the associated CURL options for a request method

@param string $method
@return void
Set the associated CURL options for a request method