HTTP(S)-POST
Practice communication between server and client using HTTP POST method with LTE-M/CAT-M1 module.
2. HTTP POST-EX1 → SIM7000 & SIM7070, SIM7080, SIM7090
NO | Command | Response | 설명 |
1 | PDP Context 설정 | ||
AT+SHCONF=”URL”,”http://httpbin.org” | OK | Set up server URL | |
AT+SHCONF=”BODYLEN”,1024 | OK | Set HTTP body length | |
AT+SHCONF=”HEADERLEN”,350 | OK | Set HTTP head length | |
AT+SHCONN | OK | Connect to HTTP server | |
AT+SHSTATE? |
+SHSTATE: 1 OK |
Check HTTP status | |
AT+SHCHEAD | OK | Clear HTTP header | |
AT+SHAHEAD=”Content-Type”,”application/x-www-form-urlencoded” | OK | Add header content | |
AT+SHAHEAD=”Cache-control”,”no-cache”\r | OK | Add header content | |
AT+SHAHEAD=”Connection”,”keep-alive” | OK | Add header content | |
AT+SHAHEAD=”Accept”,”*/*” | OK | Add header content | |
AT+SHCPARA\r | OK | Add header content | |
AT+SHPARA=”product”,”apple” | OK | Add header content | |
AT+SHPARA=”price”,”1″ | OK | Add header content | |
AT+SHREQ=”/post”,3 |
OK +SHREQ: “POST”,200,452 |
POST method | |
AT+SHREAD=0,452 |
OK +SHREAD: 452 |
||
AT+SHDISC | OK |
2. HTTP POST-EX2 → SIM700 & SIM7070, SIM7080, SIM7090
NO | Command | Response | 설명 |
1 | PDP Context 설정 | ||
2 | AT+SHCONF=”URL”,”http://httpbin.org” | OK | Set up server URL |
3 | AT+SHCONF=”BODYLEN”,1024 | OK | Set HTTP body length |
4 | AT+SHCONF=”HEADERLEN”,350 | OK | Set HTTP head length |
5 | AT+SHCONN | OK | Connect to HTTP server |
6 | AT+SHSTATE? |
+SHSTATE: 1 OK |
Check HTTP status |
7 | AT+SHCHEAD | OK | Clear HTTP header |
8 | AT+SHAHEAD=”Content-Type”,”application/x-www-form-urlencoded” | OK | Add header content |
9 | AT+SHAHEAD=”Cache-control”,”no-cache”\r | OK | Add header content |
10 | AT+SHAHEAD=”Connection”,”keep-alive” | OK | Add header content |
11 | AT+SHAHEAD=”Accept”,”*/*” | OK | Add header content |
12 | AT+SHBOD=29,10000 | > | Add header content |
13 | {“title”:”Hello http server”} | OK | Add header content |
14 | AT+SHREQ=”/post”,3 |
OK +SHREQ: “POST”,200,452 |
POST method |
15 | AT+SHREAD=0,452 |
OK +SHREAD: 452 |
Read data length is 457 |
16 | AT+SHDISC | OK | Disconnect HTTP |