Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sending JSON or multipart requests #995

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,25 +698,29 @@ protected function createRequest($method, $url, $token, array $options)
* WARNING: This method does not attempt to catch exceptions caused by HTTP
* errors! It is recommended to wrap this method in a try/catch block.
*
* @param RequestInterface $request
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given
* request and to the transfer.
* @return ResponseInterface
*/
public function getResponse(RequestInterface $request)
public function getResponse(RequestInterface $request, array $options = [])
{
return $this->getHttpClient()->send($request);
return $this->getHttpClient()->send($request, $options);
}

/**
* Sends a request and returns the parsed response.
*
* @param RequestInterface $request
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given
* request and to the transfer.
* @throws IdentityProviderException
* @return mixed
*/
public function getParsedResponse(RequestInterface $request)
public function getParsedResponse(RequestInterface $request, array $options = [])
{
try {
$response = $this->getResponse($request);
$response = $this->getResponse($request, $options);
} catch (BadResponseException $e) {
$response = $e->getResponse();
}
Expand Down