Ha, my favourite User(â¢), On 12 Jun 2013, at 18:08, "Sean P. DeNigris" <sean@clipperadams.com> wrote:
In the Jenkins REST API, you create a new job by posting a config.xml to http://server_url/createItem?name=NewJobName
Using an existing template file was easy enough: ZnClient new url: restUrl; queryAt: 'name' put: aString; uploadEntityFrom: '/path/to/config.xml'; contentType: ZnMimeType applicationXml. client post.
But what's the equivalent for using a string representing the file contents? I tried: contents: JenkinsConfigFile new contents; and entity: (ZnEntity text: JenkinsConfigFile new contents); but neither seemed to work... (500 error on the server)
Did you pass the right content type ? I would do either: client entity: (ZnEntity with: '<xml> .. </xml>' type: ZnMimeType applicationXml); or client contents: '<xml> .. </xml>'; contentType: ZnMimeType applicationXml; but I can't try it from here of course. You can always add a #logToTranscript to get some more insight into what goes over the wire. HTH, Sven
----- Cheers, Sean -- View this message in context: http://forum.world.st/Zinc-Posting-aString-tp4693047.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org