1<?php
2
3namespace OAuth\Common\Http\Client;
4
5use OAuth\Common\Http\Uri\UriInterface;
6use OAuth\Common\Http\Exception\TokenResponseException;
7
8/**
9 * Any HTTP clients to be used with the library should implement this interface.
10 */
11interface ClientInterface
12{
13    /**
14     * Any implementing HTTP providers should send a request to the provided endpoint with the parameters.
15     * They should return, in string form, the response body and throw an exception on error.
16     *
17     * @param UriInterface $endpoint
18     * @param mixed        $requestBody
19     * @param array        $extraHeaders
20     * @param string       $method
21     *
22     * @return string
23     *
24     * @throws TokenResponseException
25     */
26    public function retrieveResponse(
27        UriInterface $endpoint,
28        $requestBody,
29        array $extraHeaders = array(),
30        $method = 'POST'
31    );
32}
33