TAS:Pokročilé/Pluginy/Input, Output/Import/SolverTech.Tasha.Plugins.IO.RestApi/en: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
(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.“) |
(Žádný rozdíl)
|
Verze z 18. 8. 2022, 07:19
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"
- Open a web page that can encode to Base64 (e.g. https://www.base64encode.org/ or https://www.base64encode.net/ )
- Type tasha:password in the text box
- Click on "Encode" (or similar button)
- Copy the result to the config, in this case the string "dGFzaGE6aGVzbG8="