使用Fiddler——模拟Http请求及对android应用抓包

来源:互联网 发布:网络安全法案例 编辑:程序博客网 时间:2024/06/06 03:13

模拟Http请求

这里介绍使用Fiddler模拟两种常见的请求方式,Post请求和Get请求。
打开Fiddler

Get请求

关于Get请求不再赘述。

Post请求

首先介绍 一下Content-Type:
常见的媒体格式类型如下:

    text/html : HTML格式    text/plain :纯文本格式         text/xml :  XML格式    image/gif :gif图片格式       image/jpeg :jpg图片格式    image/png:png图片格式

以application开头的媒体格式类型:

   application/xhtml+xml :XHTML格式   application/xml     : XML数据格式   application/atom+xml  :Atom XML聚合格式      application/json    : JSON数据格式   application/pdf       :pdf格式    application/msword  : Word文档格式   application/octet-stream : 二进制流数据(如常见的文件下载)   application/x-www-form-urlencoded : <form encType=””>中默认的encType,form表单数据被编码为key/value格式发送到服务器(表单默认的提交数据的格式)

另外一种常见的媒体格式是上传文件之时使用的:

    multipart/form-data : 需要在表单中进行文件上传时,就需要使用该格式

以上就是我们在日常的开发中,经常会用到的若干content-type的内容格式。
介绍两种常见的post数据请求

Json请求

首先在Fiddler的Header文本框至少输入以下内容:

Content-Type: application/json; charset=utf-8  

在请求体中输入:
json字符串例如:

      {"UserID":4,"UserName":"Parry","UserEmail":"Parry@cnblogs.com"}

提交表单post请求

首先在Fiddler的Header文本框至少输入以下内容:

  Content-Type: application/x-www-form-urlencoded

在请求体中输入:
字符串例如:

userName=helloworld&pwd=123456

模拟表单请求在线工具:

  1. aTool在线工具
  2. coolaf
  3. PostMan PostMan的使用

关于android应用的抓包方法

如何用Fiddler对Android应用进行抓包

0 0
原创粉丝点击