me-no-dev / ESPAsyncWebServer

Async Web Server for ESP8266 and ESP32
3.7k stars 1.21k forks source link

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

Open IPdotSetAF opened 7 months ago

IPdotSetAF commented 7 months ago

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 commented 7 months ago

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

danieljharris commented 5 months ago

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