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
If using the `JsonHttpClient` the response object is returned by the termination methods listed above. If directly using the JsonRequest instance, you can get the JsonResponse object via a getter.
281
+
282
+
```{php}
283
+
// Getting the response BasicHttpClient\Response\JsonResponse object
284
+
$response = $request->getResponse();
285
+
286
+
// Reading the HTTP status code as integer; will return `200`
After successful performing the request, the effective request information is tracked back to the JsonRequest object. They can get accessed as follows.
304
+
305
+
```{php}
306
+
// Getting the effective endpoint URL including the query parameters
PHP JSON HTTP Client provides different exceptions – also provided by the PHP Common Exceptions project – for proper handling.
297
358
You can find more information about [PHP Common Exceptions at Github](https://github.com/markenwerk/php-common-exceptions).
298
359
360
+
### Exceptions to be expected
361
+
362
+
In general you should expect that any setter method could thrown an `\InvalidArgumentException`. The following exceptions could get thrown while using PHP Basic HTTP Client.
363
+
364
+
-`CommonException\IoException\FileNotFoundException` on configuring a `ClientCertificateAuthentication`instance
365
+
-`CommonException\IoException\FileReadableException` on configuring a `ClientCertificateAuthentication`instance
366
+
-`BasicHttpClient\Exception\HttpRequestAuthenticationException` on performing a request
367
+
-`BasicHttpClient\Exception\HttpRequestException` on performing a request
368
+
-`CommonException\NetworkException\ConnectionTimeoutException` on performing a request
369
+
-`CommonException\NetworkException\CurlException` on performing a request
370
+
-`BasicHttpClient\Exception\HttpResponseException` if parsing the JSON response body fails
371
+
372
+
---
373
+
299
374
## Contribution
300
375
301
376
Contributing to our projects is always very appreciated.
0 commit comments