![USR IOT USR-GPRS232-730 Скачать руководство пользователя страница 12](http://html.mh-extra.com/html/usr-iot/usr-gprs232-730/usr-gprs232-730_user-manual_1064566012.webp)
USR-GPRS232-730 User Manual
Jinan USR IOT Technology Limited
/ 45
12
3.2.2.2. Setup steps
1) Set work mode as HTTPD
AT+WKMOD=”HTTPD”
2) Set request type as GET
AT+HTPTP=”get”
3) Set the address of HTTP server as “www.usr.cn”, and set server port as 80
AT+HTPSV=”www.usr.cn”,80
4) Set the request URL as ”/1.php?”
AT+HTPURL=”/1.php?”
5) Set request head string.
AT+HTPHD=”Accept:text/html[0D][0A]Accept-Language:zh-CN[0D][0A]User-Age
nt:
Mozilla/5.0[0D][0A]Connection: Keep-Alive[0D][0A]”
<Note>
[0D] means carriage return, it is 0x0D in hex number. [0A] means line feed, it is 0x0A in hex. Because
this kind of data is not able to be put into AT commands string, so it is tropical. The rule is two bytes in [] means
one byte in hex form.
For example,
“[0D]” means carriage return, 0x0D in hex.
“[20]” means space, 0x20 in hex.
6) Restart module, send “data=http://www.usr.cn” to HTTP server, will receive [http://www.usr.cn] from
server.
<Note>
The server “www.usr.cn” is USR’s HTTP test server, if you send “data=http://www.usr.cn” to it, it will
feed back the data after “=” with “[]” including.
In step 1, serial device send “data=http://www.usr.cn” to USR-GPRS232-730, then module prepares
HTTP package with head information set before, so the package data is:
GET /1.php?data=http://www.usr.cn HTTP/1.1
Host: www.usr.cn
Accept:text/html
Accept-Language:zh-CN
User-Agent: Mozilla/5.0
Connection: Keep-Alive
After sending data, USR-GPRS232-730 receives data:
HTTP/1.1 200 OK
Date: Wed, 24 Jun 2015 04:08:35 GMT
Server: Apache/2.0.63 (Win32) mod_ssl/2.0.65 OpenSSL/0.9.8o PHP/5.2.14