With the Symfony Http Client I create a HTTP request like this: The output is: Now I try to output the url of that response: But the output is null. How can I get as an output the url www.something.com? Answer All the HttpClient responses implement the ResponseInterface, defined on Symfony Contracts. That interface declares a getInfo() method, as shown
Tag: symfony-http-client
How can I create a MockResponse with statusCode 400 header for MockHttpClient?
I would like to test different responses from an API using symfony/http-client, but how can I create statusCode 400? This is what I tried: public static function mockShipmentResponseFail(): …
Symfony HttpClient GET request with multiple query string parameters with same name
I am trying to make an API request in the following format: /api/v1/courses?enrollment_state=active&include[]=total_students&include[]=term How can I do so using the HttpClient Component …