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

JSON requests support #3504

Closed
kasun opened this issue Nov 24, 2018 · 1 comment
Closed

JSON requests support #3504

kasun opened this issue Nov 24, 2018 · 1 comment

Comments

@kasun
Copy link
Contributor

kasun commented Nov 24, 2018

This is a minor enhancement when dealing with JSON requests.

Right now to do a json request we have to do something like this,

headers = {
    'Content-Type': 'application/json'
}
yield Request(url, method='POST', body=json.loads(data), headers=headers)

I'm proposing a new Request subclass that can save a few keystrokes.

yield JSONRequest(url, data=data)

Will be sending a PR for this.

lopuhin added a commit that referenced this issue Mar 22, 2019
[MRG+2] Request subclass for json requests #3504
@kmike
Copy link
Member

kmike commented Jun 28, 2019

Fixed by #3505 .

@kmike kmike closed this as completed Jun 28, 2019
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

2 participants