/** * HTTP协议 */ 网络通讯的规范之一,不同计算机之间的通讯规范 /** * 抓包工具Fillder * / //安装Fiddler https://www.telerik.com/docs/default-source/fiddler/fiddlersetup.exe?sfvrsn=4 cmd ipconfig 记录ipv4地址:192.168.1.105 //配置手机证书 Tools Fiddler Options HTTPs 勾选Decrypt HTTPs traffic 勾选Ignore server certificate errors Tools Fiddler Options Connections选项卡 port 8888 勾选Allow romote computers to connect OK 重启Fiddler软件 //配置手机 打开android设备 设置 先正常连接网络 打开 http://192.168.1.105:8888 下载FiddlerRoot certificate 文件名输入:FiddlerRoot.cer WiFi 长按,选择“修改网络” 勾选“显示高级选项” “代理”后面的输入框选择“手动” “代理服务器主机名”后面输入ipv4地址 “代理服务器端口”后面输入8888 保存 /** * 请求Requset */ 请求首行: 请求方式 请求地址 请求协议 请求头: 键值对 Connection(连接方式): Keep-Alive保持; close连完就断 请求空行: 分割的作用 请求正文: 数据 /** * GET请求 */ /*请求首行*/ GET http://api.easou.com/api/bookapp/promotionInfo.m?session_id=&cid=eef_easou_book&version=002&os=android&udid=6E5B7509E5560BE9F5CB0FA2544F5CFE&appverion=1038&ch=blf1298_14225_001&session_id=&statId=HOqbHMcCuvzkTi5QVRa6qQIlcubbk HTTP/1.1 /*请求头*/ Host: api.easou.com Connection: Keep-Alive User-Agent: esbook android 3.1.0 Accept-Encoding: gzip,esenc /*请求空行*/ /*请求正文*/ /** * POST请求 */ /*请求首行*/ POST http://adm.easou.com/splashad HTTP/1.1 /*请求头*/ Host: adm.easou.com Connection: close User-Agent: Mozilla/5.0 (Linux; Android 5.1.1; SM-N9100 Build/LMY47X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36Accept-Encoding: gzip Accept: text/html;q=0.9,*/*;q=0.8 Accept-Charset: utf-8;q=0.7,*;q=0.3 Content-Length: 276 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 /*请求空行*/ /*请求正文*/ sdk=essdk&cngo=2&nett=3&mid=355848069184185&sim=89860116817013590566&u_h=2560&muid=5899&mac=98%3AF1%3A70%3A56%3AB6%3A24&dl=19&cid=&ct=1&u_w=1440&os=1&innercid=general&av=3.1.0&an=%E5%AE%9C%E6%90%9C%E5%B0%8F%E8%AF%B4&u_ds=4.0&ua=samsung__SM-N9100__5.1.1&mmid=2418&ver=4.3.0%3A& /** * 响应Response */ 响应首行 响应头 响应空行 响应正文 /*响应首行*/ HTTP/1.1 502 Fiddler - Connection Failed /*响应头*/ Date: Thu, 27 Apr 2017 23:13:17 GMT Content-Type: text/html; charset=UTF-8 Connection: close Cache-Control: no-cache, must-revalidate Timestamp: 07:13:17.603 /*响应空行*/ /*响应正文*/ [Fiddler] The connection to '74.125.204.113' failed. <br />Error: TimedOut (0x274c). <br />System.Net.Sockets.SocketException 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 74.125.204.113:80