Curl Problem
Posted: Tue Nov 19, 2019 10:18 am
Hello I am Ercan from Turkey,
I am working with a company works with IOT system as a PCB designer and mcu software developer. So recently I got a job and this is the first time I try something with ESP8266. I have a web service link like:
curl -X POST "http://20.20.20.20./api/be.php" -d "op=get_prof&pass=klmn&email=klm@mail.com"
this link return a json data and I tried to get this json data from esp8266-12f. so do I succeed so far, indeed not really. I do not write any code inside of esp, so I am communication with at commands. Can anyone help me about how I am going to write it truely.
I send it,
AT+CIPSTART=0,"TCP","20.20.20.20",80
and than,
AT+CIPSEND=0,98
and after '>',
curl -X POST "http://20.20.20.20./api/be.php" -d "op=get_prof&pass=klmn&email=klm@mail.com"
so all these steps it returns:
SEND OK
+IPD,0,309:HTTP/1.1 400 Bad Request
Server: nginx/1.16.1
Date: Tue, 19 Nov 2019 14:46:18 GMT
Content-Type: text/html
Content-Length: 157
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>
0,CLOSED
so it is wrong or I am writing wrongly. So anyone help me about this? How should I write? And I am really sorry if I did write it to wrong place.
I am working with a company works with IOT system as a PCB designer and mcu software developer. So recently I got a job and this is the first time I try something with ESP8266. I have a web service link like:
curl -X POST "http://20.20.20.20./api/be.php" -d "op=get_prof&pass=klmn&email=klm@mail.com"
this link return a json data and I tried to get this json data from esp8266-12f. so do I succeed so far, indeed not really. I do not write any code inside of esp, so I am communication with at commands. Can anyone help me about how I am going to write it truely.
I send it,
AT+CIPSTART=0,"TCP","20.20.20.20",80
and than,
AT+CIPSEND=0,98
and after '>',
curl -X POST "http://20.20.20.20./api/be.php" -d "op=get_prof&pass=klmn&email=klm@mail.com"
so all these steps it returns:
SEND OK
+IPD,0,309:HTTP/1.1 400 Bad Request
Server: nginx/1.16.1
Date: Tue, 19 Nov 2019 14:46:18 GMT
Content-Type: text/html
Content-Length: 157
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>
0,CLOSED
so it is wrong or I am writing wrongly. So anyone help me about this? How should I write? And I am really sorry if I did write it to wrong place.