httpd post request

chegewara
Posts: 665
Joined: Wed Jun 14, 2017 9:00 pm

httpd post request

Postby chegewara » Tue Oct 16, 2018 6:16 pm

Hi,
i am trying to start with http server. What i did is get http server example, add very simple main page with button and trying to response on POST requests. The issue i am having is that i cant do anything with too big uri/header. All i have found is this docs info.
https://docs.espressif.com/projects/esp ... tPc6size_t

I injected some logging to this function but it is never reached because server is responding with error 413 before.
https://github.com/espressif/esp-idf/bl ... .c#L39-L75

Code: Select all

D (10215) httpd_sess: httpd_sess_process: httpd_req_new
D (10216) httpd_parse: read_block: received HTTP request block size = 128
D (10217) httpd_parse: cb_url: message begin
D (10221) httpd_parse: cb_url: processing url = /
D (10226) httpd_parse: verify_url: received URI = /
D (10231) httpd_parse: cb_header_field: headers begin
D (10236) httpd_parse: pause_parsing: paused
D (10240) httpd_parse: cb_header_field: processing field = Host
D (10246) httpd_parse: read_block: received HTTP request block size = 111
D (10253) httpd_parse: continue_parsing: skip pre-parsed data of size = 5
D (10260) httpd_parse: continue_parsing: un-paused
D (10265) httpd_parse: cb_header_value: processing value = 192.168.0.10
D (10272) httpd_parse: cb_header_field: processing field = Connection
D (10278) httpd_parse: cb_header_value: processing value = keep-alive
D (10285) httpd_parse: cb_header_field: processing field = Content-Length
D (10291) httpd_parse: cb_header_value: processing value = 0
D (10297) httpd_parse: cb_header_field: processing field = Cache-Control
D (10304) httpd_parse: cb_header_value: processing value = max-age=0
D (10310) httpd_parse: cb_header_field: processing field = Origin
D (10316) httpd_parse: cb_header_value: processing value = http://192.168
D (10323) httpd_parse: parse_block: parsed block size = 111
D (10329) httpd_parse: read_block: received HTTP request block size = 128
D (10336) httpd_parse: cb_header_value: processing value = .0.10
D (10342) httpd_parse: cb_header_field: processing field = Upgrade-Insecure-Requests
D (10350) httpd_parse: cb_header_value: processing value = 1
D (10355) httpd_parse: cb_header_field: processing field = DNT
D (10361) httpd_parse: cb_header_value: processing value = 1
D (10367) httpd_parse: cb_header_field: processing field = Content-Type
D (10374) httpd_parse: cb_header_value: processing value = application/x-www-form-urlencoded
D (10382) httpd_parse: cb_header_field: processing field = User-Agent
D (10389) httpd_parse: cb_header_value: processing value = Mozilla/5.0 (Windows N
D (10396) httpd_parse: parse_block: parsed block size = 239
D (10402) httpd_parse: read_block: received HTTP request block size = 128
D (10409) httpd_parse: cb_header_value: processing value = T 10.0; Win64; x64) AppleWebKit/537.36 (KHTM
L, like Gecko) Chrome/69.0.3497.100 Safari/537.36
D (10423) httpd_parse: cb_header_field: processing field = Accept
D (10429) httpd_parse: cb_header_value: processing value = text/html,application/xht
D (10436) httpd_parse: parse_block: parsed block size = 367
D (10442) httpd_parse: read_block: received HTTP request block size = 128
D (10449) httpd_parse: cb_header_value: processing value = ml+xml,application/xml;q=0.9,image/webp,imag
e/apng,*/*;q=0.8
D (10460) httpd_parse: cb_header_field: processing field = Referer
D (10466) httpd_parse: cb_header_value: processing value = http://192.168.0.10/
D (10473) httpd_parse: cb_header_field: processing field = Accept-Encoding
D (10480) httpd_parse: cb_header_value: processing value = gzip, deflate
D (10487) httpd_parse: cb_header_field: processing field = Acc
D (10493) httpd_parse: parse_block: parsed block size = 495
D (10499) httpd_parse: read_block: received HTTP request block size = 18
D (10505) httpd_parse: cb_header_field: processing field = ept-Language
D (10512) httpd_parse: cb_header_value: processing value = pl,e
D (10518) httpd_parse: parse_block: parsed block size = 513
W (10524) httpd_parse: parse_block: response uri/header too big
W (10530) httpd_txrx: httpd_resp_send_err: 431 Request Header Fields Too Large - Header fields are too
long for server to interpret
D (10545) httpd_sess: httpd_sess_process: httpd_req_delete
D (10549) httpd_sess: httpd_sess_process: success
D (10554) httpd_sess: httpd_sess_process: httpd_req_new
D (10559) httpd_parse: read_block: received HTTP request block size = 23
W (10565) httpd_parse: parse_block: incomplete (0/23) with parser error = 16
W (10573) httpd_txrx: httpd_resp_send_err: 400 Bad Request - Server unable to understand request due to
 invalid syntax
D (10586) httpd_sess: httpd_sess_process: httpd_req_delete
D (10590) httpd_sess: httpd_sess_process: success
D (10606) httpd_sess: httpd_sess_process: httpd_req_new
D (10607) httpd_parse: read_block: connection closed
D (10609) httpd_sess: httpd_sess_delete: fd = 57

WiFive
Posts: 2157
Joined: Tue Dec 01, 2015 7:35 am

Re: httpd post request

Postby WiFive » Tue Oct 16, 2018 7:54 pm


chegewara
Posts: 665
Joined: Wed Jun 14, 2017 9:00 pm

Re: httpd post request

Postby chegewara » Wed Oct 17, 2018 2:24 am

Thanks WiFive.

Return to “ESP32 IDF”

Who is online

Users browsing this forum: No registered users and 19 guests