无法从 iPhone 向 ColdFusion API 发出 POST 请求
我在 iPhone 中制作应用程序时遇到一个奇怪的问题。问题出在向 ColdFusion 中的服务器 API 发出 POST 请求时。我们有两台服务器:一台用于测试,另一台用于生产。该应用程序在测试服务器上完美运行,但是当我们在生产服务器中执行 POST 请求时,API 无法读取请求变量并给出错误,因为 Element xxxxx is undefined in ATTRIBUTES
,但实际上它是那里。原因之一可能是不同的用户代理,但在尝试了多种组合后,它不起作用。
任何帮助将不胜感激。
I am having a strange problem while making an application in iPhone. The problem is in making a POST request to the server API in ColdFusion. We have two servers: one is for Testing and other for Production. The app works perfectly on the Testing server, but when we do a POST request in Production server the API couldn't read the request variable and gives error as Element xxxxx is undefined in ATTRIBUTES
, but actually it is there. One reason could be different User-Agents, but after trying many combinations it does not work.
Any help would be very appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不明白你为什么要谈论不同的用户代理?是 iPhone 来测试服务器还是 iPhone 来生产服务器,不是吗?配置是否完全相同,包括 Application.cfc(或 Application.cfm)?
调用 cfc 的 Web 应用程序或本机应用程序?
I don't understand why you're talking about different user-agent? It's iPhone to test server or iPhone to production server, no? Is the configuration exactly the same including the Application.cfc (or Application.cfm)?
Web app or native app calling cfc's?
我认为用户代理没有任何区别。尝试直接通过浏览器提交请求,以确保它确实有效。执行 NSLog url 请求并将其粘贴到浏览器中的最佳方法。
I don't think user-agents make any difference. Try to submit request directly through browser to make sure it is really working. Best way to do that NSLog url request and paste it in browser.
我发现了问题所在。这是我使用的“LINK”。 API 可以在链接中添加“www”,而我使用的链接不带“www”。希望它能帮助某人。
谢谢。
I figured out the problem. It was the "LINK" I was using. The API worked with adding "www" to the link, where as I was using the link without "www". Hope it helps someone.
Thanks.