I always get 401 when I try to execute a DELETE verb against a DocumentDB collection. POST for queries/inserts/updates works fine, so I am sure that my code that calculates the
There's two kinds of requests you can make to DocumentDB. One is based on the "id" property that you define, and one based on the internal resource id ("_rid"). When you're using "id", you need to use the entire link for generating the authorization token, so for delete it would look like
delete
docs
dbs/mydb/colls/mycol/docs/cc0d4caabc714aac976c9d0a2e9243ed
sun, 21 aug 2016 20:00:00
//newline
If you're using the internal resource ID, then you just pass in the "_rid" of the document you're trying to delete, for example
delete
docs
icuoakizcgadaaaaaaaaaa== //lowercase
sun, 21 aug 2016 20:00:00
//newline
One thing which might help debugging these is looking at the response body that's returned with the 401. It should contain an error message telling you the payload that the server expected.