I have a bash script which use curl:
url="https://example.com/api.cgi"
message="<?xml version=\"1.0\" encoding=\"utf-8\"?>
<request>
<encoding>utf-8</encoding>
<format>XML</format>
<foo>bar</foo>
</request>"
curl --data "${message}" --header 'Content-Type: text/xml' "${url}" --insecure -3
How to implement the same with ruby Net::HTTP?
Here’s a sample which suppresses SSL verification if you are using self signed certificates.