Questions tagged [httpx]

HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.

HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2. For more details, please check the HTTPX website.

162 questions
0
votes
2 answers

benchmark HTTP1.1/HTTP2 in python

I did some benchmark on http1.1/http2 with python, the code is as simple as repeating a Google search request many times. The result is interesting: the http2 version is slower considerably. (i tried both pycurl/httpx libraries) Can someone explain…
4bo
  • 1
  • 1
0
votes
1 answer

Examples of using authlib's httpx client asynchronously

There are several examples here of using an httpx client instead of a requests based session with the popular oauth lib, authlib However in those examples, they don't show how to properly open and close an async httpx session. See…
brno32
  • 414
  • 5
  • 17
0
votes
1 answer

Why do we need to use a Client object when sending async requests?

The interface for sending requests synchronously is very simple: # using requests package content = requests.get('http://www.example.com').content # using httpx package: content = httpx.get('http://www.example.com').content However, when sending…
tomerm98
  • 31
  • 2
0
votes
0 answers

poetry dependencies python3.4 with httpx

I'm to use pyproject.toml with poetry (1.1.5, latest). I want my package supports python>=3.4, and, if it's python>=3.6 then depends on httpx, too. Thus, the pyproject.toml is: [tool.poetry.dependencies] python = "^3.X" httpx = {version =…
pjw91
  • 1,745
  • 1
  • 11
  • 8
0
votes
0 answers

Can I use httpx to wait for the page to load?

import httpx r=httpx.get('url') I will not receive all the code of the page. How can I make all the scripts on the page load?
xidiot
  • 1
0
votes
1 answer

HTTP/2 Python-Requests, HTTPX

I am currently trying to make an HTTP/2 request to a server. I realize that when using HTTP/2 my request fails. (From server I get 'Unsupported') python-requests doesn't support HTTP/2 so I used a wrapper build around requests called HTTPX which…
HOOOPLA
  • 65
  • 3
  • 9
0
votes
1 answer

Unable to validate my query for particular website

I'm trying to query the following website where Access Number will be a fixed value of 8778791867 And the PIN will be dynamic. From the normal browser am able to check if it's valid or invalid pin. But using my code below, I'm unable to get the…
0
votes
1 answer

How to correctly index files with asynchronous csv stream data into Splunk?

I am putting asynchronous csv stream data from each URL into each file one after another like below. async with httpx.AsyncClient(headers={"Authorization": 'Token token="sometoken"'}) as session: for url in some_urls_list: …
SmiP
  • 155
  • 2
  • 2
  • 16
0
votes
1 answer

Make an async HTTP request and continue executing the loop

I have a simple python function with the following pseudo-code: while True: # 1 - CPU Intensive calculations(Synchronous) # 2 - Take the result from the synchronous calculation and POST it to a server The while loop runs forever…
Varun
  • 95
  • 1
  • 11
0
votes
1 answer

Using HTTPX for Tornado testing

I'd like to standardize the use of HTTPX for testing regardless of the Python web framework being used. I managed to get it to work with Quart and FastAPI, but I'm having issues with Tornado since it doesn't comply to ASGI, and it uses a particular…
andref
  • 750
  • 5
  • 20
0
votes
1 answer

Build an Async Python function for API

I am creating a module that communicate with an API and I am thinking to create my function with asyncio. Right now my code look like this : def getMethod(self, stuff:str=None): #yes it in a class header = {'Content-Type': 'application/json'} …
Pitchkrak
  • 340
  • 1
  • 3
  • 11
-1
votes
1 answer

Python's requests triggers Cloudflare

import requests , json from collections import OrderedDict def Core(): response = requests.Session() headers = OrderedDict({'Authorization': 'bearer 0', 'BrandType': '1', …
1 2 3
10
11