reactiveui / refit

The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
https://reactiveui.github.io/refit/
MIT License
8.42k stars 742 forks source link

[Bug]: The response header is missing #1699

Open W2426566602 opened 3 months ago

W2426566602 commented 3 months ago

Describe the bug 🐞

When I use refit to access an API interface that returns a file stream, I use the browser developer tools to look at the response details, there is the file name in the response header, but when I process the response object in the code, the response header is empty

Step to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

This should happen...

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

Refit Version

No response

Additional information ℹ️

No response

W2426566602 commented 3 months ago

image

W2426566602 commented 3 months ago

image

iwenr commented 2 months ago

image

header在Content里面吧。。

agabadave commented 2 months ago

Had the exact issue, and it turned out to be related to CORs. If you are using asp.net WebAPI, consider exposing the response headers.

ChrisPulman commented 2 months ago

Please check your CORS settings and update this issue if it's relevant, many thanks. @agabadave thanks for your input