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

body vs params option #391

Open
1 task done
Dino-Kupinic opened this issue May 2, 2024 · 0 comments
Open
1 task done

body vs params option #391

Dino-Kupinic opened this issue May 2, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Dino-Kupinic
Copy link

Describe the change

In the documentation it is advised to use body with a POST request to pass data. Though in my Symfony API the user and password property were both null despite the payload containing them both.
After looking through the code i saw the params option which worked.

Any plans on explaining this in the docs? I did not find the params option in the README

code in question:

const data = await $fetch("/login", {
    method: "POST",
    params: { usr: "user", pwd: "password" }, // body did not work
    baseURL: config.public.baseURL,
})

URLs

No response

Additional information

  • Would you be willing to help?
@Dino-Kupinic Dino-Kupinic added the documentation Improvements or additions to documentation label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant