Skip to content
Discussion options

You must be logged in to vote

Hi @giladshay!

How to use client.query(...) right now

You can easily add a .query() shortcut today by subclassing httpx.Client:

import httpx

class Client(httpx.Client):
    def query(self, url: str, **kwargs):
        return self.request("QUERY", url, **kwargs)

# Usage:
with Client() as client:
    response = client.query("https://example.org/search", json={"filter": "active"})
    print(response.json())

Will HTTPX add native httpx.query()?

Right now, HTTPX only has built-in shortcuts (.get(), .post(), etc.) for standard RFC 9110 methods.

Because RFC 10008 was just recently published as an official standard, most HTTP libraries wait for wider server and proxy adoption before adding new …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giladshay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants