src/Request/LushRequest.php
protected function addRequestBody()
    {
        if (! empty($this->payload['parameters'])) {
            if (in_array($this->method, ['DELETE', 'PATCH', 'POST', 'PUT'])) {
                $this->addCurlOption(CURLOPT_POSTFIELDS, $this->formattedRequestBody());
            } elseif (is_array($this->payload['parameters'])) {
                // append parameters in the url
                $this->payload['url'] = sprintf('%s?%s', $this->payload['url'], $this->formattedRequestBody());
            }
        }
    }
protected function addRequestBody()
    {
        if (! empty($this->payload['parameters'])) {
            if (in_array($this->method, ['DELETE', 'PATCH', 'POST', 'PUT'])) {
                $this->addCurlOption(CURLOPT_POSTFIELDS, $this->formattedRequestBody());
            } elseif (is_array($this->payload['parameters'])) {
                // append parameters in the url
                $this->payload['url'] = sprintf('%s?%s', $this->payload['url'], $this->formattedRequestBody());
            }
        }
    }
protected function addRequestBody ( ) { if ( ! empty ( $ this -> payload [ 'parameters' ] ) ) { if ( in_array ( $ this -> method , [ 'DELETE' , 'PATCH' , 'POST' , 'PUT' ] ) ) { $ this -> addCurlOption ( CURLOPT_POSTFIELDS , $ this -> formattedRequestBody ( ) ) ; } elseif ( is_array ( $ this -> payload [ 'parameters' ] ) ) { // append parameters in the url $ this -> payload [ 'url' ] = sprintf ( '%s?%s' , $ this -> payload [ 'url' ] , $ this -> formattedRequestBody ( ) ) ; } } }
Add request body.
Add request body .