[gelöst] ESP8266 evaluate html form, symbols and spaces get sent as %

Hi there,

Unfortunately, I currently have the following problem and don't know what to do next, maybe someone can give me some helpful food for thought / or a solution.

The aim of the code is to parameterize the D1 mini network settings via an html page.
The data should be sent from the form using the GET method or, best of all, even the POST method and stored in LittleFS.

I am currently using the GET method because I am not very familiar with POST. Actually, the previous code also works as soon as special characters like "!" or spaces because these are replaced by "%".

I would be very happy to receive help.
Many Thanks

Strukturiert_Homekit_Webeinrichtung_V1_20200111.ino (10.6 KB)

See URL encoding - Wikipedia.

You should not be using GET to post data to the server. Use POST. GET has different rules for caching and sending the same request multiple times which will mess things up. POST also allows you to use multipart encoding of forms, so you can avoid the URL encoding. GET requests have no body, so you can only send the form data in the URL, which requires you to URL encode it first.

Pieter

Thanks for the reply and the information,

I already know a large part of it through my internet research. Above all, the safety factor is relevant as the data from the GET method can be found in the log and is always part of the URL anyway.

Unfortunately, I don't know how to use the POST method with an Arduino.
Do you have a simple example or tip?

Paxi08:
Unfortunately, I don't know how to use the POST method with an Arduino.
Do you have a simple example or tip?

I haven't really worked with the ESP8266 in a while, but I wrote this guide a couple of years back: https://tttapa.github.io/ESP8266/Chap09 - Web Server.html, and the next page has some code examples. The guide hasn't been updated for some time, and the Arduino ESP8266 Core API might have changed, but the main idea is still the same.

Thank you very much.

The guide helped me a lot. Now i have the code running perfect with POST.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.