Http request activity response in stream format

Hi,

I am using HTTP request activity and by default its response is in string format. I want my response in stream format and I do not know how data is encoded in my HTTP response.
The HTTP response in string format is attached .
HttpOutputData.txt (18.5 KB)

Any help in this regard?

Hi,

Can you try to use ResourcePath property?

Regards,

I used the resource property and I opened it in notepad++ and I got the same weird data

@Yoichi @gustavo.cervelin I am using Deepl api in Uipath software to translate a document. UIPath HTTP request activity (https://docs.uipath.com/activities/docs/http-client)

gives output in string format. The text that I want to translate is attached in file called “InputData.txt” and the response headers that I am getting while downloading the document are

in “ResponseHeaders”. The output in string format is in HttpOutputData".

I tried different encoding schemes to get the translated text data but of no avail. Please let me know how I can get the translated data. I have to submit my project today.HttpOutputData.txt (18.5 KB)
InputData.docx (11.9 KB)
ResponseHeaders.docx (12.1 KB)

Hi,

Your response header shows the response is docx format and its size is 11395.
So can you try to set “output.docx” at ResourcePath proerty, then open it with MS-Word etc?

Regards,

I tried it this way but I am unable to open the document and when I saw in notepad++ then it was a weird data:

Hi,

Can you share the file? Is it same file size as the above text?

Regards,

Actually, I wrote the HTTP Response that is in string format to a text file by using Write text file activity as shown below and this text file is same as I attached above. So, I am assuming that this is the complete data.
image

Hi,

I don’t think it’s good way because binary data will be crashed for encoding matter.
(As result file size is increased. Original file size is 11395, but your text file size is 18994.)

Perhaps you should save response to file using ResourceProperty directly.

Regards,

This is what I got from Resource property
abc.docx (67 Bytes)
Response Header information:

Dictionary<string, string>(6) { { “Connection”, “keep-alive” }, { “Access-Control-Allow-Origin”, “*” }, { “Content-Length”, “11395” }, { “Content-Type”, “application/vnd.openxmlformats-officedocument.wordprocessingml.document” }, { “Date”, “Sun, 26 Sep 2021 11:28:35 GMT” }, { “Server”, “nginx” } }

When I use resource property, I hardly get 1Kb docx file which is weird

Hi,

The content of the file is 500_document_not_found error. Have you already upload file before then? is your document key correct?

Regards,

If I copy the HTTP Response output from clipboard to word document manually then this is the output:
HttpResponseInStringFOrmatOutput.docx (28.5 KB)