J2ME——MIDP。向服务器发出 POST 请求时出现错误(HTTP 操作中出现 40 错误)
我尝试运行从本教程复制的代码
http://www.developer.nokia.com/Community/Wiki/How_to_use_Http_POST_request_in_Java_ME
但是当我运行它时,我在源代码行中遇到异常
dis = new DataInputStream(hc.openInputStream());
java.io.IOException: 40-Error in HTTP operation
at com.sun.midp.io.j2me.http.Protocol.checkForException(+51)
at com.sun.midp.io.j2me.http.Protocol.readResponseMessage_wap(+38)
at com.sun.midp.io.j2me.http.Protocol.connect_wap(+649)
at com.sun.midp.io.j2me.http.Protocol.connect(+107)
at com.sun.midp.io.j2me.http.Protocol$PrivateOutputStream.flush(+39)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at com.orionsource.onlinenards.api.API.sendPostRequest(API.java:221)
at com.orionsource.onlinenards.api.API.helloApiWithParams(API.java:259)
at com.orionsource.onlinenards.OnLineNards.startApp(OnLineNards.java:33)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
如何解决这个问题?
i try run code copied from this tutorial
http://www.developer.nokia.com/Community/Wiki/How_to_use_Http_POST_request_in_Java_ME
But when i run it i get Exception in source code line
dis = new DataInputStream(hc.openInputStream());
java.io.IOException: 40-Error in HTTP operation
at com.sun.midp.io.j2me.http.Protocol.checkForException(+51)
at com.sun.midp.io.j2me.http.Protocol.readResponseMessage_wap(+38)
at com.sun.midp.io.j2me.http.Protocol.connect_wap(+649)
at com.sun.midp.io.j2me.http.Protocol.connect(+107)
at com.sun.midp.io.j2me.http.Protocol$PrivateOutputStream.flush(+39)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at com.orionsource.onlinenards.api.API.sendPostRequest(API.java:221)
at com.orionsource.onlinenards.api.API.helloApiWithParams(API.java:259)
at com.orionsource.onlinenards.OnLineNards.startApp(OnLineNards.java:33)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
How to resolve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一些示例代码。它会对你有所帮助。
Some sample code.It will help u.