Expose http response content headers via Box SDK
- Dominant language
- C#
- Stars
- 183
- Forks
- 160
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 15
Description
### Is your feature request related to a problem? Please describe.
The problem that I am facing is that **BoxFilesManager** does not provide an API for getting System.IO.Stream related information.
It does not expose **'content-type'**, **'content-length'** nor **'content-disposition'** content request headers.
Why am I requesting this?
Box API does not return any whatsoever mime-types.
I don't want to guess the mime-type or parse it on the fly based on the file extension of a **BoxFile**.
Working with generic mime types could introduce security issues.
I would prefer If I can return the correct mime type to the front-end, so that the browsers knows how to handle it correctly.
Would be happy to hear from you or answer questions.
Thanks!
### Describe the solution you'd like
```
See Box.V2.IBoxResponse
public interface IBoxResponse where T : class
{
...
HttpResponseHeaders Headers { get; set; }
///
/// This could be added
///
HttpContentHeaders ContentHeaders { get; set; }
}
```
```
See Box.V2.Request.HttpRequestHandler line 204 on the main branch
var boxResponse = new BoxResponse
{
Headers = response.Headers,
ContentHeaders = response.Content.Headers,
// Translate the status codes that interest us
StatusCode = response.StatusCode
};
```
Afterwards we can introduce a new set of BoxFilesManager methods that can return the response itself IBoxResponse<> or we can create a custom return type. No preference about that.
E.g.
```
Task> DownloadStreamAsync(string id, string ...)
```
Contributor guide
Assessment
This issue has not been assessed yet.