SolverTech.Tasha.Plugins.IO.RestApi

Z Solvertech
Verze z 18. 8. 2022, 07:19, kterou vytvořil Jana.safferova (diskuse | příspěvky) (založena nová stránka s textem „If the client sends you authorization in username and password format, it is necessary to encode them in username:password format to Base64.“)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Skočit na navigaci Skočit na vyhledávání
Jiné jazyky:

Plugin for receiving data using RestApi

Config example:

<?xml version="1.0" encoding="utf-8"?> <RestApiIOSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <PlanningDateFormat>yyyy-MM-dd</PlanningDateFormat>
 <Requests>
   <OrderRequest>
     <Method>POST</Method>
     <Uri><![CDATA[1]]></Uri>
     <HeaderKeyValueDelimiter>;</HeaderKeyValueDelimiter>
     <HeaderKeyValuePairs>
       <string>Accept;application/json</string>
       <string>Authorization;Basic dGFzaGE6aGVzbG8=</string> 
     </HeaderKeyValuePairs>
     <Body></Body>
     <OrdersArrayName></OrdersArrayName>
     <JoinColumnName></JoinColumnName>
   </OrderRequest>
 </Requests>

</RestApiIOSettings>


Loading data while encoding UTF-8 with BOM

If data encoded as UTF-8 with BOM is read, the following line must be added to RestApiIOSettings (e.g. under PlanningDateFormat):

<EncodingWithBOM>true</EncodingWithBOM>

Generating authorization

If the client sends you authorization in username and password format, it is necessary to encode them in username:password format to Base64.

Example generation for username "tasha" and password "password"

  1. Open a web page that can encode to Base64 (e.g. https://www.base64encode.org/ or https://www.base64encode.net/ )
  2. Type tasha:password in the text box
  3. Click on "Encode" (or similar button)
  4. Copy the result to the config, in this case the string "dGFzaGE6aGVzbG8="