On 10/15/2010 10:27 AM, Volker Lapczynski wrote:
Hello Fabio!
I solved the TAG problem, but still fighting with Umlauts.
TAGs solved: In Autohotkey environment i have to "escape" commas, they must be escaped as shown here:
tags=foo`,bar
; --- create a TAG--- Working ;) curl.exe -u "Admin:admin" -X POST -H "Content-type: application/x-www-form-urlencoded" --data-ascii "className=TagClass&property#tags=foo`,bar" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/%page%/object...
I don't really know what a "Autohotkey environment" is, but I retested it and it works perfectly without any escaping at all (though I am under Ubuntu)
Umlaut:
My code works without umlauts, but with umlaut i get a "0000: HTTP/1.1 405 Method Not Allowed"
page = test page = øæåØÆÅ
Again, tried with a BASH terminal under Ubuntu:
;-make- Runwait curl -u "Admin:admin" -X PUT -d "@1.xml" -H "Content-type: application/xml; charset=UTF-8" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/%page%
What I did: curl -u "Admin:admin" -X PUT -H "Content-type: text/plain" --data-ascii " Hello world" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/øæåØÆÅ (Which is equivalent to send an XML with the content information) Result: page created.
;-upload- RunWait curl -u "Admin:admin" -T "wordlist.txt" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/%page%/attach...
What I did: curl -u "Admin:admin" -T tagcloud3.png http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/øæåØÆÅ/attachments/øæåØÆÅ Result: attachment created (though the name is: oaeaOAEA)
;-make tag- RunWait curl -u "Admin:admin" -X POST -H "Content-type:application/x-www-form-urlencoded;charset=UTF-8" --data-binary "className=TagClass&property#tags=test" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/%page%/object...
What I did: curl -u "Admin:admin" -X POST -d "className=TagClass&property#tags=foo,bar" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/øæåØÆÅ/objects Result: Object tags created and with foo,bar tags
;-write tag- RunWait curl -u "Admin:admin" -X PUT -H "Content-type: text/plain;charset=UTF-8" --data-binary "%page%`,%page%" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/%page%/object...
What I did: curl -u "Admin:admin" -X PUT -H "Content-type: text/plain" --data-ascii "øæåØÆÅ,øæåØÆÅ" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/øæåØÆÅ/objects/TagClass/0/properties/tags Result: tags modified to øæåØÆÅ,øæåØÆÅ Bonus: I also tried with --data-binary as you did and I get the correct result. So, finally, I cannot reproduce your errors :( I don't have a Windows box to make tests with it, but I think that a possible cause is the configuration of your Windows terminal that makes curl.exe send some extra stuff that confuses the REST subsystem. For your information my BASH shell has LANG=en_US.utf8 and gnome-terminal is configured with Unicode (UTF-8) Maybe somebody else with a Window system can help you better. -Fabio