You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just want to make sure I am not missing something here:
I have an API that has a few JSON endpoints but also a few endpoints with small binary files for download. If I expose the binary as a stream as in... [Get("/v2/file.db.gz")] Task<Stream> GetFileAsync();
or as in... [Get("/v2/file.db.gz")] Task<byte[]> GetFileAsync();
Refit wants to parse the result as JSON (which of course blows up).
I could get the raw response as in... [Get("/v2/file.db.gz")] Task<HttpResponseMessage> GetFileAsync();
and then grab the stream or the bytes from response.Content in the caller.
Is this The Right Way?
The text was updated successfully, but these errors were encountered:
Nevermind. I overlooked the HttpContent support. If you set your return type Task<HttpContent>, you should be able to access the stream from the result.
Just want to make sure I am not missing something here:
I have an API that has a few JSON endpoints but also a few endpoints with small binary files for download. If I expose the binary as a stream as in...
[Get("/v2/file.db.gz")] Task<Stream> GetFileAsync();
or as in...
[Get("/v2/file.db.gz")] Task<byte[]> GetFileAsync();
Refit wants to parse the result as JSON (which of course blows up).
I could get the raw response as in...
[Get("/v2/file.db.gz")] Task<HttpResponseMessage> GetFileAsync();
and then grab the stream or the bytes from
response.Content
in the caller.Is this The Right Way?
The text was updated successfully, but these errors were encountered: