requests-threads icon indicating copy to clipboard operation
requests-threads copied to clipboard

Add example for POST request

Open panw opened this issue 6 years ago • 0 comments

Currently the documentation provides an example on for GET request. Can an example for POST request that demonstrates sending a payload and setting headers be add to the documentation?

Would it be something like this

from requests_threads import AsyncSession

session = AsyncSession(n=100)
async def _main():
  url = u"https://api.github.com/repos/psf/requests/issues/482/comments"
  body = json.dumps({u"body": u"Sounds great! I'll get right on it!"})
  response = await session.post(url=url, data=body)

Thanks

panw avatar Aug 22 '19 04:08 panw