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
AJAX with zero form fields does not send Content-Type
header
#5346
Labels
Comments
mvorisek
changed the title
[API]
AJAX with no form fields does not send Oct 12, 2023
serializeForm
with no form fields does not send Content-Type
headerContent-Type
header
mvorisek
changed the title
AJAX with no form fields does not send
AJAX with zero form fields does not send Oct 12, 2023
Content-Type
headerContent-Type
header
mgol
added
Discuss in Meeting
Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting.
Ajax
labels
Oct 30, 2023
Thanks for opening an issue. It'd be helpful if you could create a reduced test case (possibly using httpbin.org) and we can see if the behavior for your use case (1) is intended and (2) can be changed. A call to |
timmywil
added
Needs info
and removed
Discuss in Meeting
Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting.
labels
Nov 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see fomantic/Fomantic-UI#2926 issue and related discussion
Request
Content-Type
is/can be used by a webserver to determine the request type [1].Array/form data should always send
Content-Type
. Data of value "empty array" must send the header the same way as non-empty array data. This is also behaviour of native html form /wo any fields [2].non-array data ("null"/"undefined"/"false") can/should (probably) continue to send no
Content-Type
header implicitlythe LoC/condition to fix: https://github.com/jquery/jquery/blob/3.7.1/src/ajax.js#L638
[1] example https://github.com/Nyholm/psr7-server/blob/1.0.2/src/ServerRequestCreator.php#L62
[2]
<form action="/p.aspx" method="post"><input type="submit"></form>
The text was updated successfully, but these errors were encountered: