将 URLFetch 与 Http 方法“DELETE”结合使用时,appengine 中出现 Http 400;
我无法使用以下代码发出“删除”请求:
URLFetchService fetchService = URLFetchServiceFactory.getURLFetchService();
URL posturl = new URL("http://www.example.com/comment?token=xxx");
HTTPResponse response = fetchService.fetch(new HTTPRequest(posturl, HTTPMethod.DELETE));
int responseCode = response.getResponseCode();
这是针对 Google Appengine 的。 “删除”请求适用于 facebook 图形 API。上面的代码给了我一个状态代码 400 - 错误请求。
这是针对 face4j 的,这是我为 facebook 图形 API 构建的开源 Java 库。
I've been unable to make a "DELETE" request using the code below :
URLFetchService fetchService = URLFetchServiceFactory.getURLFetchService();
URL posturl = new URL("http://www.example.com/comment?token=xxx");
HTTPResponse response = fetchService.fetch(new HTTPRequest(posturl, HTTPMethod.DELETE));
int responseCode = response.getResponseCode();
This is for Google Appengine. The 'DELETE' request is for the facebook graph API. The above code gives me a status code 400 - Bad Request.
This is for face4j an open source java library that I've built for the facebook graph API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上并不是 App Engine 的问题;而是 App Engine 的问题。这只是意味着目标网络服务器不会接受您的请求。
如果您确实尝试将 DELETE 发送到 example.com,那就是您的问题了。如果这应该是一个已清理的 URL,那么您就忽略了有助于故障排除的详细信息。
This isn't really an App Engine problem; it just means that the destination webserver wouldn't accept your request.
If you're actually trying to send a DELETE to example.com, that's your problem. If that's supposed to be a scrubbed URL, you've omitted the detail that would facilitate troubleshooting.