private function createCurlOptions($method, $body = null, $headers = null)
    {
        $options = [
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADER => true,
                CURLOPT_CUSTOMREQUEST => strtoupper($method),
                CURLOPT_SSL_VERIFYPEER => true,
                CURLOPT_FAILONERROR => false
            ] + $this->curlOptions;

        if (isset($headers)) {
            $headers = array_merge($this->headers, $headers);
        } else {
            $headers = $this->headers;
        }

        if (isset($body)) {
            $encodedBody = json_encode($body);
            $options[CURLOPT_POSTFIELDS] = $encodedBody;
            $headers = array_merge($headers, ['Content-Type: application/json']);
        }
        $options[CURLOPT_HTTPHEADER] = $headers;

        return $options;
    }
private function createCurlOptions($method, $body = null, $headers = null)
    {
        $options = [
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADER => true,
                CURLOPT_CUSTOMREQUEST => strtoupper($method),
                CURLOPT_SSL_VERIFYPEER => true,
                CURLOPT_FAILONERROR => false
            ] + $this->curlOptions;

        if (isset($headers)) {
            $headers = array_merge($this->headers, $headers);
        } else {
            $headers = $this->headers;
        }

        if (isset($body)) {
            $encodedBody = json_encode($body);
            $options[CURLOPT_POSTFIELDS] = $encodedBody;
            $headers = array_merge($headers, ['Content-Type: application/json']);
        }
        $options[CURLOPT_HTTPHEADER] = $headers;

        return $options;
    }
private function createCurlOptions ( $ method , $ body = null , $ headers = null ) { $ options = [ CURLOPT_RETURNTRANSFER => true , CURLOPT_HEADER => true , CURLOPT_CUSTOMREQUEST => strtoupper ( $ method ) , CURLOPT_SSL_VERIFYPEER => true , CURLOPT_FAILONERROR => false ] + $ this -> curlOptions ; if ( isset ( $ headers ) ) { $ headers = array_merge ( $ this -> headers , $ headers ) ; } else { $ headers = $ this -> headers ; } if ( isset ( $ body ) ) { $ encodedBody = json_encode ( $ body ) ; $ options [ CURLOPT_POSTFIELDS ] = $ encodedBody ; $ headers = array_merge ( $ headers , [ 'Content-Type: application/json' ] ) ; } $ options [ CURLOPT_HTTPHEADER ] = $ headers ; return $ options ; }
Creates curl options for a request
this function does not mutate any private variables

@param string $method
@param array $body
@param array $headers

@return array
Creates curl options for a request this function does not mutate any private variables