Rails talk via XML API



How can I create request from Ruby on Rails application to XML API with such conditions:


1) Header:



Message-ID: 1
Message-Request: Request
Time: Time.current


2) Blank string between header and XML-body


3) XML-body:



<?xml version="1.0" encoding="Windows-1251" standalone="yes" ?>
<Message Action="Get info" Global_Type="ABC" Unit_ID="1" User_ID="1">
<ID_Code>123456789</ID_Code>
<Include>Holder</Include>
</Message>


I want to know about best practices (create template for requests etc.), which HttpClient I should use for it (rest-client, faraday etc.) and how t o build it.


No comments:

Post a Comment