public function make()
    {
        $this->setDefaultHeaders();

        $startTime = microtime(true);
        $result = $this->httpClient->request($this->getMethod(), $this->getURL(), $this->getPayload());
        $endTime = microtime(true);

        $this->response = new Response();
        $this->response->setExecutionTime(round(($endTime - $startTime), 5))
            ->setStatusCode($result->getStatusCode());

        // set the request ID for remote debugging if it is present            
        if (!empty(($requestID = $result->getHeader('X-Moltin-Request-Id')))) {
            $this->response->setRequestID($requestID[0]);
        }

        $body = json_decode($result->getBody());
        $this->response->setRaw($body)->parse();

        return $this;
    }
public function make()
    {
        $this->setDefaultHeaders();

        $startTime = microtime(true);
        $result = $this->httpClient->request($this->getMethod(), $this->getURL(), $this->getPayload());
        $endTime = microtime(true);

        $this->response = new Response();
        $this->response->setExecutionTime(round(($endTime - $startTime), 5))
            ->setStatusCode($result->getStatusCode());

        // set the request ID for remote debugging if it is present            
        if (!empty(($requestID = $result->getHeader('X-Moltin-Request-Id')))) {
            $this->response->setRequestID($requestID[0]);
        }

        $body = json_decode($result->getBody());
        $this->response->setRaw($body)->parse();

        return $this;
    }
public function make ( ) { $ this -> setDefaultHeaders ( ) ; $ startTime = microtime ( true ) ; $ result = $ this -> httpClient -> request ( $ this -> getMethod ( ) , $ this -> getURL ( ) , $ this -> getPayload ( ) ) ; $ endTime = microtime ( true ) ; $ this -> response = new Response ( ) ; $ this -> response -> setExecutionTime ( round ( ( $ endTime - $ startTime ) , 5 ) ) -> setStatusCode ( $ result -> getStatusCode ( ) ) ; // set the request ID for remote debugging if it is present             if ( ! empty ( ( $ requestID = $ result -> getHeader ( 'X-Moltin-Request-Id' ) ) ) ) { $ this -> response -> setRequestID ( $ requestID [ 0 ] ) ; } $ body = json_decode ( $ result -> getBody ( ) ) ; $ this -> response -> setRaw ( $ body ) -> parse ( ) ; return $ this ; }
Make a request

@return $this
Make a request