热度 21
2014-2-14 16:18
1136 次阅读|
0 个评论
我们将演示用WizFi250通过HTTP(端口80)和HTTPS(端口 443)连接Google网页服务器。 (AP Association) AT+WLEAVE AT+WSET=0,Wiznet_Kaizen AT+WSEC=0,OPEN AT+WNET=1 AT+WJOIN Joining : Wiznet_Kaizen Successfully joined : Wiznet_Kaizen IP Addr: 192.168.15.10 Gateway: 192.168.15.1 (这是用来简易分析数据的。如果你想要手动分析头部数据,可以省略这步) AT+SFORM=000000000 (找到google.com的IP地址) AT+FDNS=google.com,3000 74.125.128.102 (通过HTTP(80)连接google网页服务器) AT+SCON=O,TCN,74.125.128.102,80,0,0 (发送网页请求) AT+SSEND=0,,,18 GET / HTTP/1.1\r\n (现在,你可以通过HTTP接收来自google网页服务器的数据,如下) HTTP/1.1 302 Found Location: http://www.google.co.kr/?gws_rd=crei=pIz0UvbYBqmZiQf2zIDgCA Cache-Control: private Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=55cbe1a26a10a4a4:FF=0:TM=1391758500:LM=1391758500:S=V39C5p8-28xe7gVT; expires=Sun, 07-Feb-2016 07:35:00 GMT; path=/; domain=.google.com Set-Cookie: NID=67=eAwBBej-W68bRryLLG7O86lG5BkNJzD5GpFZxbUnkHmHs6DyaeocsgLh4yd8mYc5pzyQJxTdC4f7GfqSrbC6orrtgErxRRSC0hxloj6B53eKbRYzWeIv5PGF9UT97v2c; expires=Sat, 09-Aug-2014 07:35:00 GMT; path=/; domain=.google.com; HttpOnly ……………………………… (断开与google网页服务器的连接) AT+SMGMT=ALL 如下图片是如上HTTP示例的Wireshark抓包。 (到这步,你可以参考 Get HTTP Example ) (通过HTTPS(443)连接google网页服务器) AT+SCON=O,TCS,74.125.128.102,443,0,0 (发送网页请求) AT+SSEND=0,,,18 GET / HTTP/1.1\r\n\r\n (现在,你可以通过HTTPS从google网页服务器获得数据,如下) HTTP/1.1 302 Found Location: http://www.google.co.kr/?gws_rd=crei=pIz0UvbYBqmZiQf2zIDgCA Cache-Control: private Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=55cbe1a26a10a4a4:FF=0:TM=1391758500:LM=1391758500:S=V39C5p8-28xe7gVT; ……………………………… (断开与google网页服务器的连接) AT+SMGMT=ALL 如下图片是上面HTTPS示例的Wireshark抓包。