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

Automatically set header in prepareJsonPayload #100

Open
mskocik opened this issue Dec 13, 2022 · 3 comments
Open

Automatically set header in prepareJsonPayload #100

mskocik opened this issue Dec 13, 2022 · 3 comments

Comments

@mskocik
Copy link

mskocik commented Dec 13, 2022

I would suggest to automatically set header Content-type: application/json when calling prepareJsonPayload. Typically when doing post as json.
What do you think? I could prepare PR for this change.

@nadar
Copy link
Member

nadar commented Dec 13, 2022

Hi @mskocik

I totally agree, but this would introduce backwards compatibility break. So we need (even its ugly) another parameter for doing this, like $contenTypeJson which is false by default.

With this in mind, yes please send a PR 👍 Thanks

@nadar
Copy link
Member

nadar commented Oct 31, 2023

We are now in 3.0 dev branch, i will implement a solution for this, maybe a new method.

@mskocik
Copy link
Author

mskocik commented Oct 31, 2023

I agree with new method. Because although I think it's right to set headers in prepareJsonPayload it isn't that flexible. That's also the reason why I haven't pushed to PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants