HTTP request (GET) with zip / binary response
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-08-19 04:30 PM
Hi,
I use "HTTP Request" action from standard "Utility - HTTP" object. It works correctly, I get responses. The problem is a response type which is a zip file.
Could you give me some advices how to modify this code to get resultData in binary format (if my understanding is correct this is a valid format if reponse is the zip file)?
Using response As WebResponse = request.GetResponse()
resultHeadersJson = JsonConvert.SerializeObject(ToDictionary(response))
Dim responseStream As IO.Stream = response.GetResponseStream()
Dim sr As New IO.StreamReader(responseStream)
resultData = sr.ReadToEnd()
End Using
Thank you in advance,
------------------------------
Mateusz
RPA Developer
Warsaw
------------------------------
I use "HTTP Request" action from standard "Utility - HTTP" object. It works correctly, I get responses. The problem is a response type which is a zip file.
Could you give me some advices how to modify this code to get resultData in binary format (if my understanding is correct this is a valid format if reponse is the zip file)?
Using response As WebResponse = request.GetResponse()
resultHeadersJson = JsonConvert.SerializeObject(ToDictionary(response))
Dim responseStream As IO.Stream = response.GetResponseStream()
Dim sr As New IO.StreamReader(responseStream)
resultData = sr.ReadToEnd()
End Using
Thank you in advance,
------------------------------
Mateusz
RPA Developer
Warsaw
------------------------------
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-09-19 12:07 AM
Good question. I have the same issue when I get a response with a PDF in it. Look like the code handles only text streams. Would love to see code for binary too.
------------------------------
Anonymous Noname
Employee
Privet
America/Edmonton
------------------------------
------------------------------
Anonymous Noname
Employee
Privet
America/Edmonton
------------------------------
