Quick Start
This page will help you get up and running with wreq in minutes.
Basic GET Request
POST with JSON
import asyncio
from wreq import Client
async def main():
client = Client()
data = {"name": "John", "age": 30}
resp = await client.post("https://httpbin.org/post", json=data)
result = await resp.json()
print(result)
asyncio.run(main())
Emulation
Emulate different browsers to bypass detection:
import asyncio
from wreq import Client, Emulation
async def main():
client = Client(emulation=Emulation.Safari26)
resp = await client.get("https://tls.peet.ws/api/all")
print(await resp.text())
asyncio.run(main())
Using Proxies
import asyncio
from wreq import Client
from wreq.proxy import Proxy
async def main():
client = Client(proxy=Proxy.all("http://proxy.example.com:8080"))
resp = await client.get("https://httpbin.org/ip")
print(await resp.text())
asyncio.run(main())
Custom Headers
import asyncio
from wreq import Client
from wreq.header import HeaderMap
async def main():
client = Client()
headers = HeaderMap()
headers["User-Agent"] = "MyApp/1.0"
headers["Custom-Header"] = "value"
resp = await client.get("https://httpbin.org/headers", headers=headers)
print(await resp.text())
asyncio.run(main())
Next Steps
- See the Examples for more code samples
- Explore the API Reference for detailed documentation