How to send a long HTML body in a cURL request to create or update a wiki page

Hi, I am trying to use the API to post HTML in a wiki page using cURL. This works fine:

curl -H "Rest-User-Token: <mytoken>" -H "Rest-Method: PUT" -d "Body=text" -X POST https://<mysite>/api.ashx/v2/wikis/8/pages/207.xml

But when the HTML body is long, this error is returned: Argument list too long

I would expect something like this to work:

curl -H "Rest-User-Token: <mytoken>" -H "Content-Type: multipart/form-data" -H "Rest-Method: PUT" -d body=@html.html -X POST https://<mysite>/api.ashx/v2/wikis/8/pages/207.xml

But it simply posts the literal text @html.html on the wiki page.

Does anyone know how to send a long HTML body to the Telligent wiki with a cURL request?

Thank you for any help.

Top Replies

Parents Reply
  • Thank you, that's very helpful.

    The closest I can get is this, but it still doesn't work (it doesn't return errors -- in fact the return body seems to indicate success -- but nothing ever changes on the page).

    curl -H "Rest-User-Token: <token>" -H "Rest-Method: PUT" -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d "body=@file.html" -X POST https://<my site>/api.ashx/v2/wikis/8/pages/199.json

    I've triple checked the IDs and URLs.

    Thanks again for sharing that tip, I am one step closer.