To send an XML document in your request via PUT, assuming you've got the document serialized into a string obtainable with $theXML
, you just do this:
# Type *might* need to be text/xml
http::geturl $theServiceURL -method PUT -type application/xml -query $theXML
Of course, you've got to make sure that you handle the token that it returns right, and so on. The http
package is still pretty low-level. (For example, you'll probably have to use http::config
to set what MIME types you get in the response, and you'll need to handle redirects and cookies for sessions yourself.)
Sending JSON instead? The type then becomes application/json
. Easy!