http 回应格式

HTTP/1.1 200 OK\r\n
Set-Cookie: fsm_login=21232f297a57a5a743894a0e4a801fc3; path=/\r\n
content-type:application/json\r\n
Content-Length: 80\r\n\r\n

{"hwid":"6cda2df5b71cf8d3d24515fd308a7b73","type":"HS-30R","mac":"000C43220060"}

 

HTTP/1.1 200 OK : 回应码, 根据回应码, 浏览器做出对应动作
Set-Cookie: 设置cookie, 浏览器自动设置
content-type: 数据类型, json格式, wireshark 会自动解析为json
Content-Length: 数据部分的长度, 此标识后面所有部分都会被认为是数据

Warning:
  Content-Length, 必须写到头的最后位置,
  头的结尾 要写俩\r\n 作为结束符(即: \r\n\r\n)
 
 
posted on 2018-06-07 11:33  listenerln  阅读(202)  评论(0编辑  收藏  举报