AfterShip / aftership-sdk-php

The PHP SDK of AfterShip API
65 stars 46 forks source link

Unable to parse response body into JSON #13

Closed magnetas closed 8 years ago

magnetas commented 8 years ago

Hi.

I started getting an error about the unparseable json response.

Both when registering new trackins (create) or retreiving details (get_by_id).

It seems that GET response cannot be treated as a JSON for some reason. Exception trace leads to /aftership/aftership-php-sdk/src/AfterShip/Core/Request.php line 56 ($response = $exception->getResponse()->json();) and then to the guzzle (/Guzzle/Http/Message/Response.php:861).

Any idea why is this happening?

What can be done to avoid the issue?

marekyggdrasil commented 8 years ago

Hello.

Could you please let us know which version of SDK are you using?

Reason I am asking is we recently updated AfterShip PHP SDK, now there is no Guzzle in our dependencies.

I will gladly provide some examples and help once I know more details. Meanwhile I encourage you to update and try the latest version based on Curl, probably the issue will occur no more.

Best regards. Keep us updated.

magnetas commented 8 years ago

Hello.

I believe we're using the 4.0.0 version.

The problem doesn't happen all the time though.

sunnychow commented 8 years ago

Could you update to 5.0.5 version?

sunnychow commented 8 years ago

close it as it should work in after 5.0.5 version