Is it possible to use the retrieveURL javaaction from the community commons module to run the following PUT request? curl -v -H 'Accept: application/xml' -H 'Content-Type: application/xml; charset=utf-8' -H 'Content-Length: 0' -u [MyAPIKey]: -X PUT https://..... If it is possible to carry out such a request, what is the syntax to specify the header elements? Or do I have to do it in java myself? Thanks
Yes you can but there are some pitfalls
If you don't need the -u [MyApiKey] this may be a direction. Otherwise create you http request with httpclient.
Create your request string (https://www.domain.com¶m1=a¶m2=2...)
Encode that url (see java action at the end)
Create reply document (xml)
Import the returned filedocument (xmlimport, xsd etc). Add some error handling in there because the returned xml may have multiple formats. One for the correct result and the other for errors. If you are lucky you can read the status easily from the xml.
// create new encoded URL
URI uri = new URI(httpPart, domainPart, sub, apiPart, null);
java.net.URL url = uri.toURL();