Problem adding http headers in UWP app

0 votes

So, I'm attempting to build a UWP application. Now, I'm trying to send HTTP(s) requests to a remote server with which I'm faced with issues adding HTTP headers "Content-Type". I have tried to use method HttpRequestMessage.Headers but in vain. 

Can anyone help me out here?

Jan 16 in IoT (Internet of Things) by Upasana
• 7,440 points
12 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("<type>"));

this ought to do the trick for you.

Good Luck!
answered Jan 16 by Shubham
• 12,030 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Display time in a Windows Core IoT app with a clock!

It is possible, but you should understand ...READ MORE

answered Jul 9, 2018 in IoT (Internet of Things) by nirvana
• 3,040 points
46 views
0 votes
1 answer

How to get Unicast, Dns and Gateway Address in UWP?

Try this code Snippet I found here: https://social.msdn.microsoft.com/Forums/en-US/27a8b7a8-8071-4bc1-bbd4-e7c1fc2bd8d7/windows-10-iot-core-how-do-you-create-a-tcp-server-and-client?forum=WindowsIoT ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
81 views
0 votes
1 answer

Finding the Unicast, DNS and Gateway Address in UWP

Try the PInvoke api methods from Iphlpapi.dll. ...READ MORE

answered Aug 20, 2018 in IoT (Internet of Things) by nirvana
• 3,040 points
28 views
0 votes
1 answer

Access Serial Ports in Windows 10 IoT App

On Windows IoT you have to use Windows.Devices.SerialCommunication namespace ...READ MORE

answered Oct 10, 2018 in IoT (Internet of Things) by anonymous2
• 4,260 points
40 views
+1 vote
2 answers
0 votes
1 answer

What OS is Jenkins installed on Azure Virtual Machine?

Under Managed Jenkins there's a section called ...READ MORE

answered Apr 4, 2018 in DevOps & Agile by DareDev
• 6,520 points
24 views
+1 vote
4 answers

Where to find the Microsoft.IdentityModel dll?

I finally found this Nuget package: https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM, which ...READ MORE

answered Oct 23, 2018 in Azure by Trisha
222 views
+1 vote
4 answers

How do Connect to Azure website via FTP?

First set up your FTP credentials are ...READ MORE

answered Oct 23, 2018 in Azure by abc
141 views
0 votes
1 answer

How to detect presence of a device in a WiFi network?

Finding the mac-address would probably work. Basically, ...READ MORE

answered Nov 16, 2018 in IoT (Internet of Things) by Shubham
• 12,030 points
29 views
0 votes
1 answer

Detecting when a sensor is not sending data to Orion CB in FiWARE

Orion in itself has no such mechanism ...READ MORE

answered Nov 21, 2018 in IoT (Internet of Things) by Shubham
• 12,030 points
19 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.