Preamble

Glue code between services spends its life in HTTP. requests with a Session enables connection pooling, cookie persistence, and shared headers—fewer TCP handshakes, clearer lifecycle than one-off get() calls. urllib remains the stdlib path when dependencies must stay minimal (embedded tooling, locked-down images).


Operational correctness: timeouts

Always set connect and read timeouts. Infinite waits turn slow dependencies into thread or connection pool exhaustion. Pair timeouts with retries only when idempotency holds.


Logging and correlation

Log status codes, latency, and correlation IDs (OpenTelemetry Traces Across Python and Java) at boundaries. Most “mystery” outages start as retry storms or 5xx without request context.


When urllib wins

Minimal dependency trees, bootstrap scripts, or environments where vendoring requests is politically hard—urllib is verbose but transparent.


Conclusion

Prefer requests for service code readability; choose urllib when constraints demand stdlib-only. A Minimal Spring Boot Service: Endpoints and Configuration carries the same “explicit errors at service boundaries” mindset on the JVM side.