You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So in this case, you'd unserialize it back into a PHP object.
But there can also be error responses with string response bodies. In those cases, the $exception->getResponseBody() would return the response body.
Since an SDK client app can't tell if the string should be unserialized or not, and unserialize is a dangerous method (see the docs), I have filed an enhancement request to always return the responseBody as a string. Then the SDK client can handle the JSON if it wants to with no unserialize method needed. Internal ticket DCM-4286
In my application there is a small chance of error when sending, so I wrap this in a try catch block and catch a standard
Exception
as $exception.So when I do
$exception->getResponseBody()
instead of getting on object, I get a string like so:I want the message attribute but the response body is not an object.
I also tried json decoding it. Any ideas?
The text was updated successfully, but these errors were encountered: