RainZhai / rainzhai.github.com

宅鱼
http://rainzhai.github.io
Apache License 2.0
2 stars 0 forks source link

使用fiddler测试jsonp接口 #14

Open RainZhai opened 7 years ago

RainZhai commented 7 years ago

打开Fiddler. 在AutoResponder里,添加Rule, 使用正则表达式匹配JSONP请求的URL 示例: Rule Editor regex:^http://jex.im/api.cgi\?callback=(.+) http://localhost/test.php?callback=$1

比如针对微博请求接口,可以这样配置: Rule Editor regex:^http://jex.im/api/MicroBlogServlet\?(.+) http://localhost/test.php?$1

这样请求http://jex.im/api/MicroBlogServlet?jsoncallback=MTHEQOQT5C6G0PM2&type=netease&count=10&uid=1 就会取请求到http://localhost/test.php?jsoncallback=MTHEQOQT5C6G0PM2&type=netease&count=10&uid=1 的数据