function createHttpRequest()
    {
        $headers = [
            'User-Agent' => $this->getContext()->getUserAgent(),
            'Content-Type' => 'application/x-www-form-urlencoded'
        ];

        $body = $this->buildQuery($this->getRequestParameters());

        return $this->getContext()->getMessageFactory()->createRequest(
            'POST',
            $this->getEndpoint(),
            $headers,
            $body
        );

        $httpRequest = new Request(
            'POST',
            $this->getEndpoint(),
            $headers,
            $body
        );

        return $httpRequest;
    }
function createHttpRequest()
    {
        $headers = [
            'User-Agent' => $this->getContext()->getUserAgent(),
            'Content-Type' => 'application/x-www-form-urlencoded'
        ];

        $body = $this->buildQuery($this->getRequestParameters());

        return $this->getContext()->getMessageFactory()->createRequest(
            'POST',
            $this->getEndpoint(),
            $headers,
            $body
        );

        $httpRequest = new Request(
            'POST',
            $this->getEndpoint(),
            $headers,
            $body
        );

        return $httpRequest;
    }
function createHttpRequest ( ) { $ headers = [ 'User-Agent' => $ this -> getContext ( ) -> getUserAgent ( ) , 'Content-Type' => 'application/x-www-form-urlencoded' ] ; $ body = $ this -> buildQuery ( $ this -> getRequestParameters ( ) ) ; return $ this -> getContext ( ) -> getMessageFactory ( ) -> createRequest ( 'POST' , $ this -> getEndpoint ( ) , $ headers , $ body ) ; $ httpRequest = new Request ( 'POST' , $ this -> getEndpoint ( ) , $ headers , $ body ) ; return $ httpRequest ; }
Converts the request to a PSR-7 RequestInterface

@return \Psr\Http\Message\RequestInterface
Converts the request to a PSR - 7 RequestInterface