So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By jimg
#65431 This is probably not the right place to ask this, but I couldn't find where the question should go.

I'm trying to set up an ESP as a simple server. I made a simple page with three text boxes and submit button. When I open the web page from my browser, it send this to the esp (in the following text, when I dump the input and output, I put square brackets around any character less than 32)-
Code: Select allGET / HTTP/1.1[13][10]
Host: 192.168.1.4[13][10]
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0[13][10]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[13][10]
Accept-Language: en-US,en;q=0.5[13][10]
Accept-Encoding: gzip, deflate[13][10]
Connection: keep-alive[13][10]
Upgrade-Insecure-Requests: 1[13][10]
[13][10]


The esp responds with-
Code: Select allHTTP/1.1 200 OK[13][10]
Content-Type: text/html; charset=ISO-8859-1[13][10]
Cache-Control: no-cache[13][10]
Transfer-Encoding: chunked[13][10]
[13][10]
128[13][10]
<html>[9]<head>[9]<title>TimeAll</title>[9]</head> <body>[9]<form action="" method="get">[13][10]
[9]Text1: <input type="text" name="text1"><br>[13][10]
   Text2: <input type="text" name="text2"><br>[13][10]
   Text3: <input type="text" name="text3"><br>[13][10]
[9]<input type="submit" value="Submit the Data">[13][10]
[9]</form>[9]</body></html>[13][10]
0[13][10]
[13][10]

and the browser displays the page correctly. I then enter "line 1" in the first text box, tab and enter "line 2" in the second text box, and then hit return (which I assume automatically presses the submit button) and the browser send the following to the ESP-
Code: Select allGET /?text1=line+1&text2=line+2&text3= HTTP/1.1[13][10]
Host: 192.168.1.4[13][10]
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0[13][10]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[13][10]
Accept-Language: en-US,en;q=0.5[13][10]
Accept-Encoding: gzip, deflate[13][10]
Referer: http://192.168.1.4/[13][10]
Connection: keep-alive[13][10]
Upgrade-Insecure-Requests: 1[13][10]
[13][10]


Now the question:

In the message the browser sent, the first line that says "GET /?text1=line+1&text2=line+2&text3=", what does the question mark mean? I went through dozens of sites describing the GET method for http, and nowhere can I find a description of what the question mark or anything else following the GET / is supposed to mean. I can guess it might means "Is this acceptable?" or something similar, but I would really like to get some hard documentation on what the stuff following "GET /" is. There might be dozens of symbols I need to respond to, but there is no mention in all the RFC's I've gone through. If anyone can point me to a document, I would greatly appreciate it.

Also, why do I get a plus sign instead of a space in the value the browser returns? If I enter "line++1" and "line 2" and "line +3" I get "GET /?text1=line%2B%2B1&text2=line+++2&text3=line+%2B3 " so it appears it replaces spaces with plus signs and plus signs with %2, is there other character replacements that can occur, and where can I get hard documentation about that.

Again, apologies if this is the wrong place to ask this, but I really didn't know where to ask.
Last edited by jimg on Mon May 01, 2017 9:27 am, edited 1 time in total.
User avatar
By jimg
#65445 As is usually the case, I can struggle for a week looking for an answer, and as soon as I post the question somewhere, I find the answer elsewhere. Anyway, for anyone else looking for this information, it can be found here https://en.wikipedia.org/wiki/URL and https://en.wikipedia.org/wiki/Query_string