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, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
814 views

1 answer to this question.

0 votes
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("<type>"));

this ought to do the trick for you.

Good Luck!
answered Jan 16, 2019 by Shubham
• 13,490 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 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,557 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,240 points
1,221 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,130 points
915 views
0 votes
1 answer

Access Serial Ports in Windows 10 IoT App

On Windows IoT you have to use ...READ MORE

answered Oct 10, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
2,169 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,890 points
861 views
+1 vote
3 answers

Where to find the Microsoft.IdentityModel dll?

Include Microsoft.IdentityModel.Extensions for WIF runtime support by following the following ...READ MORE

answered Oct 23, 2018 in Azure by Progbaaa
8,680 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
4,415 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
• 13,490 points
3,359 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 22, 2018 in IoT (Internet of Things) by Shubham
• 13,490 points
753 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP