-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(http): Add support for requesting body as URLSearchParams type #37767
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
Conversation
There is no support for URLSearchParams type request in the current version. This commit adds serialize body function for URLSearchParams type.
IE doesn't support URLSearchParams. There was no condition for an unsupported browser. It will fix unit test failure.
The If clause was not properly formatted. Bazel format command solved this issue to correct the file's format.
As per alfaproject's review, I changed isURLSearchParams input parameter value's type from any to unknown.
petebacondarwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sera0731 - thanks for sending in this PR.
I note that @ajitsinghkaler also created a PR at #37852. But since yours came first I would like to help you to get this merged if you are still interested.
I think that serializing the value to a string is not the correct approach. Instead I think we should do similar to the other PR where we treat it like a special type that just gets passed through - like Blob and FormData. The gives the most flexibility to the caller to then use the URLSearchParams API to extract what they want.
Can you update your code to do this and change the test accordingly?
|
👍 to @petebacondarwin's requests. Additionally, this PR is currently 4 separate commits - it should probably be squashed into a single commit with the full implementation, and a commit message describing the changes being made and why in more detail. |
|
Reverting to #37852 due to a lack of response. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
There is no support for URLSearchParams type request in the current version. This commit adds serialize body function for URLSearchParams type.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: 36317
There is no support for URLSearchParams type request in the current version. When a user passes the body parameter with this type, Angular considers it as a random object. It ends up being omitted.
What is the new behavior?
This commit adds serialization for URLSearchParams type. It will handle URLSearchParams type request, it will not be omitted.
Does this PR introduce a breaking change?
Other information