I’d hope that it was the same HTTP request. A web search says that requests has debug logging to show what its doing.
On this page search from “debug” and it shows how to turn on the debug logging in requests: Developer Interface — Requests 2.32.3 documentation
We’re sending the same parameters to the same URL. In one case we are handling the query encoding in the other requests is. AFAICT that’s the only difference but I’m curious as to why it would impact the performance.
The vendor doesn’t know how to write an API. It doesn’t paginate and can return thousands of results. We made this change to lower the number of timeouts (and we use a 60 second timeout.)
My first think would be that the server is caching the response. If the server is caching based on the exact URL, manually constructing the URL might be triggering cache hits, whereas using requests.get with params could be modifying the query string in a way that prevents the cache from being utilized effectively.
It also depends on how they tested performance. If you first test with requests and then test with the manual one right after, but the URL winds up being the same in either case, then it will seem faster because of the cache. You’d need to do the tests in both orders with different params to make sure it’s not just “whichever one you do first is slower”.