src/rehyved/Http/HttpRequest.php
private function request(string $path, string $method, $body = null): HttpResponse
    {
        $ch = curl_init();

        $this->processUrl($path, $ch);

        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

        $this->processBody($ch, $body); // Do body first as this might add additional headers
        $this->processHeaders($ch);
        $this->processCookies($ch);

        return $this->send($ch);
    }
private function request(string $path, string $method, $body = null): HttpResponse
    {
        $ch = curl_init();

        $this->processUrl($path, $ch);

        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

        $this->processBody($ch, $body); // Do body first as this might add additional headers
        $this->processHeaders($ch);
        $this->processCookies($ch);

        return $this->send($ch);
    }
private function request ( string $ path , string $ method , $ body = null ) : HttpResponse { $ ch = curl_init ( ) ; $ this -> processUrl ( $ path , $ ch ) ; curl_setopt ( $ ch , CURLOPT_CUSTOMREQUEST , $ method ) ; $ this -> processBody ( $ ch , $ body ) ; // Do body first as this might add additional headers $ this -> processHeaders ( $ ch ) ; $ this -> processCookies ( $ ch ) ; return $ this -> send ( $ ch ) ; }
Constructs the HTTP request and sends it using the provided method and request body
@param string $path the path to send the request to
@param string $method the HTTP method to use
@param mixed|null $body the body to send
@return HttpResponse the response after sending the HTTP request
Constructs the HTTP request and sends it using the provided method and request body