浏览器和应用程序的不同响应?

时间:2011-08-25 08:58:54

标签: iphone objective-c ios

当我尝试访问我的应用程序的URL时,在浏览器中我得到一个响应,但是当在应用程序中使用相同的URL时,我得到了一些其他响应。你认为是什么问题?

在浏览器中输出:

−
<Rowsets DateCreated="2011-08-25T02:56:24" EndDate="2011-08-25T02:55:59" StartDate="2011-08-25T01:55:59" Version="12.1.8 Build(20)">
−
<Rowset>
−
<Columns>
<Column Description="Role" MaxRange="1" MinRange="0" Name="Role" SQLDataType="1" SourceColumn="Role"/>
</Columns>
−
<Row>
<Role>Administrator</Role>
</Row>
−
<Row>
<Role>Everyone</Role>
</Row>
−
<Row>
<Role>QUALITY_REVIEWER</Role>
</Row>
−
<Row>
<Role>SAP_XMII_Developer</Role>
</Row>
−
<Row>
<Role>SAP_XMII_User</Role>
</Row>
</Rowset>
</Rowsets>

在控制台/应用程序中输出

<?xml version="1.0" encoding="UTF-8"?>
<Rowsets DateCreated="2011-08-25T04:55:37" EndDate="2011-08-25T04:55:11" StartDate="2011-08-25T03:55:11" Version="12.1.8 Build(20)"> 
<FatalError>
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
</FatalError>
</Rowsets>

2 个答案:

答案 0 :(得分:1)

您得到的是错误消息,而不是请求的数据 - 请参阅回复正文。

检查你的通话程序

答案 1 :(得分:0)

浏览器请求与您未看到的应用请求之间可能存在一些非显而易见的差异。如果您使用Safari作为浏览器,请尝试启用开发人员工具并打开Web检查器。您可以查看浏览器请求的详细信息,发送的任何标题等。您的应用可能不会发送所有完全相同的内容。

如果您确实想要详细比较这两个请求,请使用工具捕获HTTP流量并显示它。我使用TuffCode的HTTPScoop,但还有很多其他方法可以监控流量。使用这样的工具,您可以捕获您从浏览器发出的请求以及您从应用程序发出的请求,并进行比较。