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 json_request decorator with test-cases #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nitinbhojwani
Copy link

This PR includes:

  1. decorator json_request to parse input from request and keep it in request.data
  2. test cases for newly added decorator

Behaviour of json_request:
By default, assume_json = True and request.data = {}

     1. If assume_json is True,
            > parse request.body as JSON; if error occurs in parsing, skip.

     2. If assme_json is False,
            > If request's method is GET parse request.GET for data
            > Else If request's method is POST parse request.POST for data

vilos added a commit to vilos/django-jsonview that referenced this pull request Oct 27, 2016
@nitinbhojwani nitinbhojwani force-pushed the add-json-request-decorator branch 2 times, most recently from 9811572 to 3183068 Compare March 25, 2017 17:57
@nitinbhojwani nitinbhojwani force-pushed the add-json-request-decorator branch from 3183068 to 40623e1 Compare March 25, 2017 17:59
@nitinbhojwani
Copy link
Author

@jsocol : Please do a review.

@nitinbhojwani
Copy link
Author

Please review this PR.

@jsocol jsocol changed the base branch from master to main January 31, 2021 18:51
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

Successfully merging this pull request may close these issues.

1 participant