question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpClient enhancements - binary data

See original GitHub issue

Currently HttpClient cannot be used to retrieve binary data such as images. The response content appears to get truncated at zero bytes when the HTTP response is returned from JS back to .NET. In some cases, requests just fails with “SCRIPT7017: Memory index is out of range” (Edge) or “RuntimeError: memory access out of bounds” (Chrome) without anything being returned.

I found a TODO regarding this issue in the code (see below). Anyway, I think this should be tracked and I hope this isn’t a duplicate.

https://github.com/aspnet/Blazor/blob/a9c45fe78ac18b6bd524904b40896c249f9f09c0/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/Http.ts#L32-L47

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SteveSandersonMScommented, May 23, 2018

@rockfordlhotka byte[] is now handled for both sending and receiving thanks to aspnet/Blazor#815

1reaction
aguacongascommented, Apr 13, 2018

Upload/Download progression events

Read more comments on GitHub >

github_iconTop Results From Across the Web

HttpClient enhancements - binary data · Issue #16257
Currently HttpClient cannot be used to retrieve binary data such as images. The response content appears to get truncated at zero bytes when ......
Read more >
Post byte array to Web API server using HttpClient
Since there is a byte array, I don't want to serialize it as JSON, and want to post it as binary data to...
Read more >
system.net.httpClient().request() is doing some ...
httpClient () to POST the contents of that file via HTTP. ... httpClient().request() is doing some uncommanded encoding on my binary data.
Read more >
How to send a binary file with the HTTP client as part of a ...
Enhancement Number. Cause. Resolution. Binary file (PDF) has to become a object representation of an ABL primitive MEMPTR and then passed as ...
Read more >
Using binary content type in HTTP client - Studio
In postman I am able to use the binary content type to upload a file as seen here. However, I cannot find an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found