http://www.posttestserver.com/data/2017 ... 1687365710 for the form-based (ESP8266 successful method) and
http://www.posttestserver.com/data/2017 ... 1631253740 for the javascript (ESP8266 unsuccessful method).
I believe it does have something to do with the way ESP parses the request since the PHP based server was successful both times while ESP failed in one of them. Maybe it has something to do with LWIP implementation. Maybe not. Anyway - not a javascript problem although I suspect that once it gets figured out, javascript will need to provide the workaround.
Any other information needed?