0

我想知道是否有人知道使用PhoneGap 捕获请求响应正文的方法?我正在尝试上传文件,我需要查看正在发送/接收的内容。我正在努力解决这个问题。

 var ft = new FileTransfer();
    console.log("file transfer created...");
    ft.upload(imageURI, serverURI, function(r){console.log("Response = " + r.response);}, function(error){console.log(error);alert('Error uploading image')}, options);

这是我从服务器打印到 weinre 控制台的响应:

bytesSent: 13148
response: "[]"
responseCode: 200

我正在使用 weinre 检查任何日志和其他信息,但这还不够。我真的需要查看请求,类似于萤火虫的请求。任何帮助都是极好的。谢谢!

4

2 回答 2

0

您可能需要设置WiresharkEthereal以查看客户端和服务器之间发生了什么。响应是 serverURI 发送回设备的任何内容。它不会向您显示已发送的内容。

于 2012-05-03T15:30:15.520 回答
0

我遇到过同样的问题。原来上传 uri 重定向请求到登录页面。

于 2013-11-03T23:00:08.113 回答