Not sure, but I tried with curl (and an iOS token):
First attempt:
curl -u "2060b510-49ad-4b6b-996d-7a7521f22f73:3baddabb-5582-4991-a2a0-438b933d8090" -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://127.0.0.1:8080/ag-push/rest/registry/device/someDeviceToken
|
* Hostname was NOT found in DNS cache
|
* Trying 127.0.0.1...
|
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
|
* Server auth using Basic with user '2060b510-49ad-4b6b-996d-7a7521f22f73'
|
> DELETE /ag-push/rest/registry/device/753001cfe05111b4c4a640a1d629f139d50460415a1e343a0ac941b5d1dd9826 HTTP/1.1
|
> Authorization: Basic MjA2MGI1MTAtNDlhZC00YjZiLTk5NmQtN2E3NTIxZjIyZjczOjNiYWRkYWJiLTU1ODItNDk5MS1hMmEwLTQzOGI5MzNkODA5MA==
|
> User-Agent: curl/7.37.1
|
> Host: 127.0.0.1:8080
|
> Accept: application/json
|
> Content-type: application/json
|
>
|
< HTTP/1.1 204 No Content
|
< Connection: keep-alive
|
< X-Powered-By: Undertow/1
|
* Server WildFly/8 is not blacklisted
|
< Server: WildFly/8
|
< Access-Control-Allow-Credentials: true
|
< Content-Length: 0
|
< Date: Thu, 22 Jan 2015 09:11:20 GMT
|
<
|
* Connection #0 to host 127.0.0.1 left intact
|
I got a 204, indicating a successful deletion.
Now second time:
curl -u "2060b510-49ad-4b6b-996d-7a7521f22f73:3baddabb-5582-4991-a2a0-438b933d8090" -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://127.0.0.1:8080/ag-push/rest/registry/device/someDeviceToken
|
* Hostname was NOT found in DNS cache
|
* Trying 127.0.0.1...
|
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
|
* Server auth using Basic with user '2060b510-49ad-4b6b-996d-7a7521f22f73'
|
> DELETE /ag-push/rest/registry/device/753001cfe05111b4c4a640a1d629f139d50460415a1e343a0ac941b5d1dd9826 HTTP/1.1
|
> Authorization: Basic MjA2MGI1MTAtNDlhZC00YjZiLTk5NmQtN2E3NTIxZjIyZjczOjNiYWRkYWJiLTU1ODItNDk5MS1hMmEwLTQzOGI5MzNkODA5MA==
|
> User-Agent: curl/7.37.1
|
> Host: 127.0.0.1:8080
|
> Accept: application/json
|
> Content-type: application/json
|
>
|
< HTTP/1.1 404 Not Found
|
< Connection: keep-alive
|
< X-Powered-By: Undertow/1
|
* Server WildFly/8 is not blacklisted
|
< Server: WildFly/8
|
< Access-Control-Allow-Credentials: true
|
< Content-Length: 0
|
< Date: Thu, 22 Jan 2015 09:11:28 GMT
|
<
|
* Connection #0 to host 127.0.0.1 left intact
|
I am getting a 404, as expected since the token is not around (or not found in the DB for deletion).
However, I am not getting a 405 (Not allowed method). I wonder why that happens with the Android SDK.
|