25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

HTTP Delete item

This commit is contained in:
Eric Cestari 2010-09-07 16:42:12 +02:00
parent 363711a370
commit 31da259a75
2 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,12 @@ User ability to post is based on node configuration.
User ability to post is based on node configuration. User ability to post is based on node configuration.
### Deleting an item ###
$ curl -u jid:password -i -X DELETE http://post:port/pshb/domain/node/itemid
User ability to post is based on node configuration.
### Creating a new node ### ### Creating a new node ###

View File

@ -116,6 +116,14 @@ out(Args, 'POST', [_D, _Node]=Uri, {_User, _Domain} = UD) ->
out(Args, 'PUT', [_D, _Node, Slug]=Uri, {_User, _Domain} = UD) -> out(Args, 'PUT', [_D, _Node, Slug]=Uri, {_User, _Domain} = UD) ->
publish_item(Args, Uri, Slug, UD); publish_item(Args, Uri, Slug, UD);
out(Args, 'DELETE', [_D, Node, Id]= Uri, {User, UDomain}) ->
Host = get_host(Uri),
Jid = jlib:make_jid({User, UDomain, ""}),
case mod_pubsub:delete_item(get_host(Uri), list_to_binary(Node), Jid, Id) of
{error, Error} -> error(Error);
{result, Res} -> success(200)
end;
out(Args, 'PUT', [_Domain, Node]= Uri, {User, UDomain}) -> out(Args, 'PUT', [_Domain, Node]= Uri, {User, UDomain}) ->
Host = get_host(Uri), Host = get_host(Uri),