Bug 38975 - UriImageSource - Support addition of custom HTTP headers.
Summary: UriImageSource - Support addition of custom HTTP headers.
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-22 04:48 UTC by Matthew Robbins
Modified: 2017-03-26 23:02 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Matthew Robbins 2016-02-22 04:48:01 UTC
When using UriImageSource in Xamarin Forms to specify the content of an ImageView, you are currently unable to specify additional HTTP headers.

This is a problem because the UriImageSource cannot access images that require authentication to access and developers are reduced to hackery to make it work.

Could the UriImageSource please be extended to allow for custom http headers.

For instance:

var imageSource = new UriImageSource("https://www.authenticated.site/image.png", new Dictionary<string, string>() {
 {"Authorization", "Bearer " + authToken},
 {"Accept", "application/json"},
});
Comment 1 Matthew Robbins 2016-02-22 04:48:18 UTC
=== Xamarin Studio ===

Version 5.10.2 (build 56)
Installation UUID: 0c4328cb-e1b1-4543-8254-d92b3ee4da80
Runtime:
	Mono 4.2.2 (explicit/996df3c Wed Jan 20 00:19:48 EST 2016)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020030

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.1.10 (Business Edition)
Android SDK: /Users/matthewrobbins/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.2.1 (9548.1)
Build 7C1002

=== Xamarin.iOS ===

Version: 9.4.1.25 (Business Edition)
Hash: 962a050
Branch: master
Build date: 2016-01-29 16:59:11-0500

=== Xamarin.Mac ===

Version: 2.4.1.6 (Starter Edition)

=== Build Information ===

Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 16:24:41-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-lion-cycle6-c6sr1

=== Operating System ===

Mac OS X 10.11.3
Darwin JobAdders-iMac-6.local 15.3.0 Darwin Kernel Version 15.3.0
    Thu Dec 10 18:40:58 PST 2015
    root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
Comment 2 Paul DiPietro [MSFT] 2017-03-26 23:02:27 UTC
Thank you for your feedback! As this is not a bug, we believe your enhancement request would be suited as a UserVoice suggestion[1] or a proposal in our Evolution forum[2] so the team can consider adding this feature in the future. Before submitting to the forums be sure to first read the contribution guidelines[3] so your proposal can be discussed among the team and other users. 

[1] https://xamarin.uservoice.com/forums/144858-xamarin-platform-suggestions
[2] https://forums.xamarin.com/categories/xamarin-forms-evolution
[3] https://forums.xamarin.com/discussion/84503/please-read-first