ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

POST not accepting content type: application/x-www-form-urlencoded

Open IPdotSetAF opened this issue 4 months ago • 2 comments

POST endpoint does not accept content type: application/x-www-form-urlencoded

this content type is used for form data submission in html.

because we are using POST request the form data will not be provided in the query params and will be in the request body, but even the body handler does not execute with this content type.

IPdotSetAF avatar Feb 22 '24 14:02 IPdotSetAF

looks like it only accepts application/json as content type!!!! HTML form does not support that encoding

IPdotSetAF avatar Feb 22 '24 14:02 IPdotSetAF

For whatever reason application/x-www-form-urlencoded is treated differently to all other content types: https://github.com/me-no-dev/ESPAsyncWebServer/blob/f71e3d427b5be9791a8a2c93cf8079792c3a9a26/src/WebRequest.cpp#L146

danieljharris avatar Apr 04 '24 21:04 danieljharris