0

I use MvxImageView with a binding to ImageUrls with the following format:

http://mysite/service/service.svc/rest/Image/flag/<picture size>/country/<Country ID>

an example would be:

http://mysite/service/service.svc/rest/Image/flag/48/country/104
http://mysite/service/service.svc/rest/Image/flag/48/country/141

which returns a 48x48 pixel image of the Swiss flag in png format for the first link and a Spanish flag for the second link. Does MvxImageView or any of its helpers depend on a unique filenames including an file extension?
Or could even the "service.svc" be the problem and be interpreted as the filename?

According to the webserver logs the App doesn't even open the Url. When I tried with another picture from another server it worked perfectly fine.

EDIT:

On further investigation I've found out that the Accept Header of the request isn't accepted by my webservice. Can I add it somewhere?

So my Question transforms to: How can I override the MvxFileDownloadRequest class to add an accept header?

Nexus2k
  • 345
  • 1
  • 4
  • 13
  • Have you installed the DownloadCache and File plugins? MvvmCross needs those if you're binding an image view to a URL. – Kiliman Apr 09 '14 at 00:21

1 Answers1

0

How can I override the MvxFileDownloadRequest class to add an accept header?

The only way to do this is to implement your own IMvxHttpFileDownloader implementation and to register it with IoC in place of the default one.

The source for the default one is https://github.com/MvvmCross/MvvmCross/blob/v3.1/Plugins/Cirrious/DownloadCache/Cirrious.MvvmCross.Plugins.DownloadCache/MvxHttpFileDownloader.cs and this question was similar - MvvmCross HTTP DownloadCache with authentication - if this is a common request, then happy to see this pushed back into MvvmCross core.

Community
  • 1
  • 1
Stuart
  • 66,722
  • 7
  • 114
  • 165