http-delete

How to use HTTP method DELETE on Google App Engine?

陌路散爱 提交于 2019-12-04 04:10:10
I can use this verb in the Python Windows SDK. But not in production. Why? What am I doing wrong? The error message includes (only seen via firebug or fiddler) Malformed request or something like that My code looks like: from google.appengine.ext import db from google.appengine.ext import webapp class Handler(webapp.RequestHandler): def delete(self): key = self.request.get('key') item = db.get(key) item.delete() self.response.out.write(key) Your handler looks OK, are you sure you're sending the request correctly? Using jQuery, this works for me (both using dev_appserver and google app engine

DELETE using CURL with encoded URL

寵の児 提交于 2019-12-03 10:24:54
问题 I’m trying to make a request using CURL like this: curl -X DELETE "https://myhost/context/path/users/OXYugGKg207g5uN/07V" where OXYugGKg207g5uN/07V is a hash, so I suppose that I need to encode before do this request. I have tried curl -X DELETE --data-urlenconded "https://myhost/context/path/users/OXYugGKg207g5uN/07V" Some ideas? 回答1: If really OXYugGKg207g5uN/07V is the hash then you need to encode that, not the whole url. You can use an encoding function available inside the environment

Is a response-body allowed for a HTTP-DELETE-request?

耗尽温柔 提交于 2019-12-03 04:01:09
问题 I assume the response code 200 always allows for a response-body, but I can't find any explicit mention of response-bodies for DELETE-requests. 回答1: It is explicitly mentioned here in the RFC The short answer is: You should include a response body with an entity describing the deleted item/resource if you return 200 . 202 is something like an asynchronous request/response return status. 204 says explicitly that you do not include a response body 回答2: Yes, you should usually respond with a 200

RESTful undelete

我怕爱的太早我们不能终老 提交于 2019-12-03 02:57:33
问题 It is a fairly common requirement to support undeletes or delayed/batched deletions for data services. What I'm wondering is how to implement this in a RESTful way. I'm torn between a few different options (none of which seems terribly attractive to me). Common across these different options, I believe, is the need for an API which returns all resource marked as deleted for a particular resource type. Here are some options I've thought about and some of their pros/cons: Options to mark

DELETE using CURL with encoded URL

偶尔善良 提交于 2019-12-03 00:54:24
I’m trying to make a request using CURL like this: curl -X DELETE "https://myhost/context/path/users/OXYugGKg207g5uN/07V" where OXYugGKg207g5uN/07V is a hash, so I suppose that I need to encode before do this request. I have tried curl -X DELETE --data-urlenconded "https://myhost/context/path/users/OXYugGKg207g5uN/07V" Some ideas? If really OXYugGKg207g5uN/07V is the hash then you need to encode that, not the whole url. You can use an encoding function available inside the environment you use cURL in. Try this curl -X DELETE "https://myhost/context/path/users/$(echo -ne "OXYugGKg207g5uN/07V" |

Is a response-body allowed for a HTTP-DELETE-request?

喜你入骨 提交于 2019-12-02 17:22:25
I assume the response code 200 always allows for a response-body, but I can't find any explicit mention of response-bodies for DELETE-requests. fyr It is explicitly mentioned here in the RFC The short answer is: You should include a response body with an entity describing the deleted item/resource if you return 200 . 202 is something like an asynchronous request/response return status. 204 says explicitly that you do not include a response body Yes, you should usually respond with a 200 response code as per the W3C spec : 9.7 DELETE The DELETE method requests that the origin server delete the

RESTful undelete

我的梦境 提交于 2019-12-02 16:31:45
It is a fairly common requirement to support undeletes or delayed/batched deletions for data services. What I'm wondering is how to implement this in a RESTful way. I'm torn between a few different options (none of which seems terribly attractive to me). Common across these different options, I believe, is the need for an API which returns all resource marked as deleted for a particular resource type. Here are some options I've thought about and some of their pros/cons: Options to mark resource as deleted: Use HTTP DELETE to mark the resource as deleted. Use HTTP PUT/POST to update deleted

Laravel API, how to accept DELETE method

∥☆過路亽.° 提交于 2019-12-02 12:02:21
I need to use my API to delete some entities, I create my controller, my methods, the routes. They works fine, all the get and put/patch method works, but with the delete one I have and error throw by my Angular app who consume this api, here is the error : DELETE (Method Not Allowed) In my api route file I set this : header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, PATCH, DELETE'); header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Origin, Authorization, X-HTTP-Method-Override'); Anyone know why it's not working ? Edit:

WEB API 2 Delete returns 405

我是研究僧i 提交于 2019-12-02 01:07:12
I'm trying to do create a delete function in my web API class. I had problems earlier with using the Put and Patch Http messages since these were being linked to WebDAV. After changing this the Patch and Put worked but the Delete is giving me issues. Here is my class: [RoutePrefix("api/Account")] public class AccountController : ApiController { //private AuthRepository _repo = null; Orchestrate.Net.Orchestrate orchestrate = new Orchestrate.Net.Orchestrate("0b42c04c-0d70-4da8-a3c1-2036882369d0"); [..rest of class here..] // DELETE: api/account/5 [AllowAnonymous] [HttpDelete] public void Delete

body is empty when parsing DELETE request with express and body-parser

白昼怎懂夜的黑 提交于 2019-12-01 18:56:17
I'm using expressjs and the body-parser middleware. This is how I initiate it: app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); From the client I'm sending a DELETE request and when I try to pick it up from the server side I get an empty object: app.delete('/', function(req, res) { console.log(util.inspect(req.body)); //outputs {} //some more code }); however when I send it with a POST I get what I need: app.post('/delete', function(req, res) { console.log(util.inspect(req.body)); //outputs { mid: 'ffw1aNh2' } //some more code }); It is worth noting that I don't