Skip to content

Commit

Permalink
Bump Symfony version, added method to get raw response content
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan770 committed Dec 8, 2020
1 parent 144c69e commit b88aae3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
"type": "library",
"license": "MIT",
"require": {
"symfony/http-client": "^5.0",
"symfony/browser-kit": "^5.0",
"illuminate/support": "^8.0",
"php": "^7.3"
"symfony/http-client": "^5.2",
"symfony/browser-kit": "^5.2",
"illuminate/support": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"illuminate/container": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/pipeline": "^8.0"
Expand Down
13 changes: 12 additions & 1 deletion src/Response/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,21 @@ public function getContent($throw = true)
try {
return $this->toCollection();
} catch (JsonException $exception) {
return $this->baseResponse->getContent($throw);
return $this->getRawContent($throw);
}
}

/**
* Get body of response
*
* @param bool $throw
* @return string
*/
public function getRawContent($throw = true)
{
return $this->baseResponse->getContent($throw);
}

/**
* Pass response content to function
*
Expand Down

0 comments on commit b88aae3

Please sign in to comment.