PUT command in xwiki

535 views Asked by At

i'm trying to change the content of a page in xwiki with a put command . in the rest API documentation of wiki:

HTTP Method: PUT
     Accepted Media types:
        application/xml (Page element)
        text/plain (Only page content)
        application/x-www-form-urlencoded (allowed field names: title, parent, content)
     Media types:
        application/xml (Page element)
     Description: Create or updates a page.
     Status codes:
        201: If the page was created.
        202: If the page was updated.
        304: If the page was not modified.
        401: If the user is not authorized.

i tried something like that :

$ curl -X PUT -text/plain -T"C:\Users\braimm\Desktop\text.txt" \
"http://localhost:8082/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/TestPage1/"

but it doesn't work, it seems that i have to specify the media types, does anyone try to do something like that, i want just to change the content of a page with a PUT command. thanks

1

There are 1 answers

0
Med braim On

i did it with that:

$ curl -u user:password -X PUT -T "@content" -H "Content-Type: text/plain" \
       localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/{PageName}

this one change the content of a page in wiki