Pop\Curl\Curl::getBody PHP Method

getBody() public method

Get the cURL response body
public getBody ( ) : string
return string
    public function getBody()
    {
        return $this->body;
    }

Usage Example

Beispiel #1
0
 /**
  * Send transaction
  *
  * @param  boolean $verifyPeer
  * @return void
  */
 public function send($verifyPeer = true)
 {
     $this->buildRateRequest();
     $options = array(CURLOPT_POST => true, CURLOPT_POSTFIELDS => $this->accessRequest . $this->rateRequest, CURLOPT_HEADER => false);
     if (!$verifyPeer) {
         $options[CURLOPT_SSL_VERIFYPEER] = false;
     }
     $curl = new Curl($this->url, $options);
     $curl->execute();
     $this->response = simplexml_load_string($curl->getBody());
     $this->responseCode = (int) $this->response->Response->ResponseStatusCode;
     if ($this->responseCode == 1) {
         $this->responseMessage = (string) $this->response->Response->ResponseStatusDescription;
         foreach ($this->response->RatedShipment as $rate) {
             $this->rates[self::$services[(string) $rate->Service->Code]] = (string) $rate->TotalCharges->MonetaryValue;
         }
     } else {
         $this->responseCode = (string) $this->response->Response->Error->ErrorCode;
         $this->responseMessage = (string) $this->response->Response->Error->ErrorDescription;
     }
 }
All Usage Examples Of Pop\Curl\Curl::getBody