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

request()->postData() not working for JSON requests #25

Open
patrickvuarnoz opened this issue Nov 26, 2024 · 0 comments
Open

request()->postData() not working for JSON requests #25

patrickvuarnoz opened this issue Nov 26, 2024 · 0 comments

Comments

@patrickvuarnoz
Copy link

The postData() method only looks at $_POST which does not cover the data from a JSON request body:

public static function postData($item = null, $default = null)
{
    return \Leaf\Anchor::deepGet($_POST, $item) ?? $default;
}

Interestingly the get() method does. And rawData() also. This might be confusing for someone not sending form data to the server as it is not intuitive.

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