I define scoped clients in config for each external API. In tests, I inject MockHttpClient with predefined MockResponse objects — no network calls, deterministic results. In dev, I check the HttpClient profiler panel for request details.
Symfony HttpClient provides a PSR-18 compatible client with scoping (base_uri per named client), automatic JSON decoding, retry on failure, and async capabilities. Configure named clients in framework.yaml under http_client.scoped_clients. For testing: use MockHttpClient with MockResponse to simulate API responses without hitting real endpoints. Strong candidates discuss: the difference between streaming and buffered responses, using the retry_failed option with custom strategies, ScopedHttpClient for API-specific configuration, and CachingHttpClient for reducing external calls.
Tests how candidates handle external integrations. Those who use raw cURL or Guzzle in Symfony miss the framework integration. Those who cannot explain how to test external API calls will write untestable, fragile code.