Skip to content

Allow proxies in httpx.request() high-level API #1195

Closed

Description

@florimondmanca

Spun up from #1194

The high-level API functions such as httpx.get() and httpx.post() don't allow passing proxies=... yet (only possible on Client), but Requests does support this: https://requests.readthedocs.io/en/master/user/advanced/#proxies

We should add support for this argument:

>>> import httpx
>>> proxies = "http://localhost:8899"
>>> r = httpx.get("https://example.com", proxies=proxies)

We may need to update some documentation (for example, the HTTP Proxying docs may need to clarify that proxies does not require using clients), but we can treat that as a follow-up if it's unclear what should be updated exactly.

Activity

  1. added
    enhancementNew feature or request
    requests-compatIssues related to Requests backwards compatibility
    proxiesIssues related to HTTP and SOCKS proxies
    on Aug 19, 2020
  2. lovelydinosaur commented on Aug 19, 2020

    @lovelydinosaur
    Member

    Right, we may also want a note in the requests compat. section, because Session.request(...) allows a proxies=... argument, whereas Client.request(...) does not.

    (Which is because of the knock on implications of our tighter Transport API vs. requests adapters.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersproxiesIssues related to HTTP and SOCKS proxiesrequests-compatIssues related to Requests backwards compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions