1

Im having trouble getting a successful HTTP GET request to a domain under 000webhost.com

I am trying to do a GET request which sends data to a php file on my domain and save it to MySQL database. I also did this first on my browser and it works fine so I don't think there are problem in my php file.

MY DOMAIN: wastedb.000webhostapp.com

But if I try to send a request to dweet.io, it works as expected.

I am using a modified version of Adafruit_FONA library and will post the code snippet and response from serial monitor below.

Here are the parameters that I used for the WORKING GET request:

Host Address: www.dweet.io

Host: dweet.io

Response from Serial monitor for dweet.io (working):

---> AT+CHTTPSSTART
<--- OK
---> AT+CHTTPSOPSE="www.dweet.io",80,1
<--- OK
---> AT+CHTTPSSEND=64
<--- >
---> GET /dweet/for/gearhead?hello=world HTTP/1.1
Host: dweet.io
<--- OK
---> AT+CHTTPSSEND
<--- OK
<--- +CHTTPSSEND: 0
---> AT+CHTTPSRECV?
<--- +CHTTPSRECV: LEN,361
---> AT+CHTTPSRECV=361
<--- OK
+CHTTPSRECV: DATA,361
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Date: 2019年1月30日 00:16:43 GMT
Connection: keep-alive
Content-Length: 196
{"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing
---> AT+CHTTPSCLSE
<--- OK
---> AT+CHTTPSSTOP
<--- OK

As we can see, the Arduino received a JSON response from the website.

Here are the parameters that I used for the NOT WORKING GET request:

Host Address: wastedb.000webhostapp.com

Host: wastedb.000webhostapp.com

Response from Serial monitor for wastedb.000webhostapp.com (NOT WORKING):

---> AT+CHTTPSSTART
<--- OK
---> AT+CHTTPSOPSE="wastedb.000webhostapp.com",80,1
<--- OK
---> AT+CHTTPSSEND=113
<--- >
---> GET /wastedb/get_location.php?lat=14.640155&lon=120.974920&stat=LOW HTTP/1.1
Host: wastedb.000webhostapp.com
<--- OK
---> AT+CHTTPSSEND
<--- ERROR

Am I missing something here? Seems like the shield cannot find the Host Server I provided for my website.

EDIT: It is working now. The only solution that worked for me is to find another hosting site.

VE7JRO
2,51519 gold badges27 silver badges29 bronze badges
asked Jan 30, 2019 at 1:13
1
  • Please consider answering your own question with the information in your "edit". After a day or two, you can accept your answer as the solution. Commented May 29, 2019 at 16:54

2 Answers 2

4

Try just using IP address for the Host line instead. I did the same thing for POST and it works fine for me.

Example:

Host: 13.xxx.xx.xx

sucessful POST

answered May 29, 2019 at 10:11
-1

It is working now. The only solution that worked for me is to find another hosting site.

answered May 30, 2019 at 11:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.