public function retrievePact($providerName, $consumerName, $version, $tagName = null, ResponseFormatter $responseFormatter = null)
    {
        $request = $this->requestBuilder->createRetrievePactRequest($this->baseUrl, $consumerName, $providerName, $version, $tagName);

        $response = $this->client->sendRequest($request);
        $this->checkIfResponseIsCorrect($response);

        return new Contract(
            $response->getHeader('X-Pact-Consumer-Version') ? $response->getHeader('X-Pact-Consumer-Version')[0] : '',
            $responseFormatter ? $responseFormatter->format($response) : $response
        );
    }