From 03901946ba88f8fe9b296c53a521a50e9aa523dd Mon Sep 17 00:00:00 2001 From: mjcross Date: Mon, 15 Feb 2021 21:08:29 +0000 Subject: [PATCH] Explain how to fix 'httpd_parse: header too long' Because this is the 'simple' server example, it is probably where users will start out to understand the HTTP Server API; and also where they might come if they are having problems. So I think it is useful to explain to users what to do if they see "httpd_parse: parse_block: request URI/header too long", which can easily happen if they submit a POST from an HTML form (for example). That certainly would have helped me! Merges https://github.com/espressif/esp-idf/pull/6547 Signed-off-by: Shubham Kulkarni --- examples/protocols/http_server/simple/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/protocols/http_server/simple/README.md b/examples/protocols/http_server/simple/README.md index 30eed559a5..5c6b9ab684 100644 --- a/examples/protocols/http_server/simple/README.md +++ b/examples/protocols/http_server/simple/README.md @@ -20,5 +20,7 @@ The Example consists of HTTPD server demo with demostration of URI handling : * since the server echoes back the request body, the two files should be same, as can be confirmed using : "cmp anyfile tmpfile" 3. "curl -X PUT -d "0" 192.168.43.130:80/ctrl" - disable /hello and /echo handlers 4. "curl -X PUT -d "1" 192.168.43.130:80/ctrl" - enable /hello and /echo handlers + +* If the server log shows "httpd_parse: parse_block: request URI/header too long", especially when handling POST requests, then you probably need to increase HTTPD_MAX_REQ_HDR_LEN, which you can find in the project configuration menu (`idf.py menuconfig`): Component config -> HTTP Server -> Max HTTP Request Header Length See the README.md file in the upper level 'examples' directory for more information about examples.