src/DataStore/src/DataStore/HttpClient.php
protected function initHttpClient(string $method, string $uri, $ifMatch = false)
    {
        $httpClient = clone $this->client;
        $httpClient->setUri($uri);
        $httpClient->setOptions($this->options);

        $headers['Content-Type'] = 'application/json';
        $headers['Accept'] = 'application/json';

        if ($ifMatch) {
            $headers['If-Match'] = '*';
        }

        $httpClient->setHeaders($headers);

        if (isset($this->login) && isset($this->password)) {
            $httpClient->setAuth($this->login, $this->password);
        }

        $httpClient->setMethod($method);

        return $httpClient;
    }
protected function initHttpClient(string $method, string $uri, $ifMatch = false)
    {
        $httpClient = clone $this->client;
        $httpClient->setUri($uri);
        $httpClient->setOptions($this->options);

        $headers['Content-Type'] = 'application/json';
        $headers['Accept'] = 'application/json';

        if ($ifMatch) {
            $headers['If-Match'] = '*';
        }

        $httpClient->setHeaders($headers);

        if (isset($this->login) && isset($this->password)) {
            $httpClient->setAuth($this->login, $this->password);
        }

        $httpClient->setMethod($method);

        return $httpClient;
    }
protected function initHttpClient ( string $ method , string $ uri , $ ifMatch = false ) { $ httpClient = clone $ this -> client ; $ httpClient -> setUri ( $ uri ) ; $ httpClient -> setOptions ( $ this -> options ) ; $ headers [ 'Content-Type' ] = 'application/json' ; $ headers [ 'Accept' ] = 'application/json' ; if ( $ ifMatch ) { $ headers [ 'If-Match' ] = '*' ; } $ httpClient -> setHeaders ( $ headers ) ; if ( isset ( $ this -> login ) && isset ( $ this -> password ) ) { $ httpClient -> setAuth ( $ this -> login , $ this -> password ) ; } $ httpClient -> setMethod ( $ method ) ; return $ httpClient ; }
Create http client

@param string $method ('GET', 'HEAD', 'POST', 'PUT', 'DELETE')
@param string $uri
@param bool $ifMatch
@return Client
Create http client