code: private function __setRequestType($ch, $type = 'GET')
      {
          $this->current_method = strtoupper($type);
  
          switch ($type) {
              case 'GET':
                  break;
              case 'POST':
                  curl_setopt($ch, CURLOPT_POST, true);
                  break;
              case 'PUT':
                  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
                  break;
              case 'DELETE':
                  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
                  break;
              case 'HEAD':
                  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
                  curl_setopt($ch, CURLOPT_NOBODY, true);
                  break;
              case 'OPTIONS':
                  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'OPTIONS');
                  break;
              default:
                  throw new \Exception('No request type is provided for request. Use post, put, delete, get or appropriate constants.');
          }
      }
docs: Set request type.
  If request type is wrong an Exception will be thrown.
  
  @param resource $ch. Curl resource.
  @param string $type Request type. Options: get, post, put, delete.
  @throws \Exception
  @return void