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

Post body format for Laravel API #99

Closed
lelu0 opened this issue Jun 12, 2024 · 3 comments
Closed

Post body format for Laravel API #99

lelu0 opened this issue Jun 12, 2024 · 3 comments

Comments

@lelu0
Copy link

lelu0 commented Jun 12, 2024

Hi,
I have a Laravel API which is working fine in postman while is setup like this:
image

When I use same setup in the plugin, input isn't correct as you can see on the screen when I dumped response:
image
image

Could you assist me with this? What body format should be used to API parse input correctly? I'm using Laravel native Request class so I'm sure that API is working correctly.

@royshil
Copy link
Collaborator

royshil commented Jun 13, 2024

This output you're getting is not valid JSON for some reason
But you can try parsing it anyway (probably would fail)
You most likely need headers on your request to ask for a JSON output
Like Content-Type: application/json (this is more for your provided body, not for the output)
Or better Accept: application/json

@lelu0
Copy link
Author

lelu0 commented Jun 13, 2024

Yes, you are right. If someone ends up looking for the answer here are the correct settings:
image

@royshil
Copy link
Collaborator

royshil commented Jun 19, 2024

done here

@royshil royshil closed this as completed Jun 19, 2024
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

2 participants