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

How to get Revert payload from PSR-7 compliant request object? #262

Closed
Cohaven opened this issue Mar 13, 2019 · 1 comment
Closed

How to get Revert payload from PSR-7 compliant request object? #262

Cohaven opened this issue Mar 13, 2019 · 1 comment

Comments

@Cohaven
Copy link

Cohaven commented Mar 13, 2019

Summary

I'm trying to incorporate the revert action into my server code, however, I'm having trouble getting the ID from a PSR-7 compliant request object. I thought that it may be a problem with the revert action using the DELETE method which may not be widely supported, but after customizing the revert action through setOptions to use the POST method, I still can't get the ID.

I've unsuccessfully tried the following methods for retrieving the ID:

  1. $body = $request->getParsedBody();
  2. $params = $request->getParams();
  3. $body2 = $request->getBody();

Google Chrome developer tools network tab does show that there is a Request Payload with the correct ID value in the revert requests.

@Cohaven
Copy link
Author

Cohaven commented Mar 13, 2019

$request->getBody()->getContents() seems to be the right way to get plaintext payload.
This post inspired me to try this option.

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