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

Device parameter is not parsed from request body if sent with 'content-type: json'. #58

Open
sun opened this issue Mar 9, 2022 · 0 comments
Assignees

Comments

@sun
Copy link
Collaborator

sun commented Mar 9, 2022

Discovered during #33

Problem

  • When sending REST parameters as a JSON object together with a Content-Type: json instead of multipart/form-data, then the device parameter is not handled; i.e., the device is not registered and does not appear in the user account.

Cause

  • The code directly accesses $_POST['device'] instead of retrieving the request parameter from WP_REST_Request.
@sun sun self-assigned this Mar 9, 2022
@sun sun changed the title Device parameter is not parsed from request body if sent with content-type application/json Device parameter is not parsed from request body if sent with content-type: json Mar 9, 2022
@sun sun changed the title Device parameter is not parsed from request body if sent with content-type: json Device parameter is not parsed from request body if sent with 'content-type: json'. Mar 9, 2022
@sun sun mentioned this issue Mar 9, 2022
11 tasks
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