Formatting XML wiki page through Rest API
Added by LA D. over 10 years ago
Hello,
I'm currently trying to update wiki pages on our Redmine through curl PUT and XML format but I'm experiencing some bad behavior.
The usual text format (*, font-size, newline...) syntax is stripped into the page after a PUT. The connection and upload are working great, it's just about text format which put all on one-line and thus doesn't make difference between a .h1 and %{font-size:xxpt}
eg of text input XML :
<?xml version="1.0"?> <wiki_page> <text> h1. TITLE %{font-size:14pt}SUBTITLE% (is OK) *IP* 1.1.1.1 with *PTR* test.test.com. *Created* the 2014-05-27T15:26:52Z *Specs* 8192 4VCPU 8192MB 40GB </text> </wiki_page>
Any help would be appreciable,
Regards
Replies (1)
RE: Formatting XML wiki page through Rest API
-
Added by Lucile Quirion about 10 years ago
Hello,
You should use curl's option '--data-binary'
This posts data exactly as specified with no extra processing whatsoever
curl -v -u login:password -H "Content-Type: application/xml" -X PUT <REDMINE_URL>/projects/foo/wiki/page_test.xml --data-binary "@wiki.xml"
I tested it with Redmine 2.6.1.
I've updated the wiki Rest_api_with_curl
Regards