简体   繁体   中英

How does apache 2 server process http GET request?

I was trying an IOT project where in I want to update the database remotely using ESP8266-01 module. I have the php file to update the database, but to execute that I am trying with GET method. Unfortunately, it wan't working. The server received the request in the access.log, but wan't updating the database. Wanted to debug, so I had this question.

The entry in the access.log is as follows:

192.168.43.150 - - [18/Mar/2017:20:23:40 +0000] "GET collectdata.php?status=1 HTTP/1.1\\r\\nHost: 192.168.43.92\\r\\n\\r\\n" 400 0 "-" "-"

This looks wrong: GET collectdata.php...

That needs to be a full path, eg. GET /collectdata.php or GET /scripts/collectdata.php , or similar.

The 400 response code you're seeing in the log means "Bad request", and the lack of a leading slash (and the rest of the path, if needed) is what Apache is complaining about.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM