http
http copied to clipboard
Return Headers when downloading a file
Is your feature request related to a problem? Please describe.
In my use case I'd like to download files via this plugin and store a reference in my database. For further procedures I need the mime type which could be retrieved via Content-Type header in the response object. But unfortunately this plugin does not grant access to response metadata when using the downloadFile
method.
Describe the solution you'd like
Make the HttpDownloadFileResult
object extend the HttpResponse
so that status code and headers will be returned.
Describe alternatives you've considered Making a request beforehand to get the mime type via HEAD request is not viable since I am doing a lot of requests resulting in 2x the request amount.
Additional context
This is a very important feature, caching is impossible without it.
I would like to add to this request as being able to access headers on the response is a really helpful feature.