Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for POST request #11

Open
panw opened this issue Aug 22, 2019 · 0 comments
Open

Add example for POST request #11

panw opened this issue Aug 22, 2019 · 0 comments

Comments

@panw
Copy link

panw commented Aug 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant