I’m using connected container (on-prem) Azure Form Recognizer. I have this POST swagger url, however I’m not sure how to use this in UiPath HTTP request especially using application/octet stream. There’s other format such as application/pdf. However, there’s no template for the body. Anyone has an idea how I can pass the pdf in my local?
Regards,
Azeem
ppr
(Peter Preuss)
June 14, 2023, 12:52pm
2
for the swagger testing use the file upload
ppr
(Peter Preuss)
June 14, 2023, 12:54pm
3
in general we readin the file into a binary stream and use it later in the body
Any idea how can I pass the binary data as input?
Regards,
Azeem
ppr
(Peter Preuss)
June 14, 2023, 1:38pm
5
can you please share the sample curl with me? Thanks
curl -X 'POST' \
'http://localhost:5000/formrecognizer/v2.1/custom/models/4eaf3437-973a-4773-9867-b9e79a9f55c5/analyze' \
-H 'accept: application/json' \
-H 'Content-Type: application/octet-stream' \
--data-binary '@BMC_20220315122254-5.pdf'
I’m sorry for the delay.
Regards,
Azeem
ppr
(Peter Preuss)
June 15, 2023, 7:55am
7
have a look here as well:
https://docs.uipath.com/marketplace/automation-cloud/latest/user-guide/microsoft-azure-form-recognizer-about
for a custom code implementation we can derive from Curl:
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "http://localhost:5000/formrecognizer/v2.1/custom/models/4eaf3437-973a-4773-9867-b9e79a9f55c5/analyze"))
{
request.Headers.TryAddWithoutValidation("accept", "application/json");
request.Content = new StringContent("@BMC_20220315122254-5.pdf");
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
var response = await httpClient.SendAsync(request);
}
}
But we would also recommend to checkout the Azure Rest API Docu for more details
Thanks @ppr ,
I hope to find an answer by using HTTP request. Btw, I’ll try the code.
I have checked this before, it is not updated.
Yes, I have check the docs but no reference is available for local path.
Regards,
Azeem