public function send(Request $request)
 {
     $this->setOptions($request->getOptions());
     switch ($this->method) {
         case CURL::DELETE:
             $this->addOption(CURLOPT_CUSTOMREQUEST, CURL::DELETE);
             break;
         case CURL::PUT:
             $this->addOption(CURLOPT_PUT, true);
             $this->addOption(CURLOPT_POST, $request->getPayload());
             break;
         case CURL::POST:
             /**
              * curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
              * curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);        
              * curl_setopt($ch, CURLOPT_HTTPHEADER, array(
              * 'Content-Type: application/json',
              * 'Content-Length: ' . strlen($data_string))                                                                       
              * );                                                                                                                    
              */
             $this->addOption(CURLOPT_CUSTOMREQUEST, CURL::POST);
             $this->addOption(CURLOPT_POSTFIELDS, $request->getPayload());
             $this->addOption(CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json', 'Content-Length: ' . strlen($request->getPayload())));
             break;
     }
     curl_setopt_array($this->handler, $this->getOptions());
     $response = Response::newResponse(curl_exec($this->handler), curl_getinfo($this->handler), curl_error($this->handler));
     return $response;
 }