Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:49:02+00:00 2026-06-08T05:49:02+00:00

im in .Net 4.0 and attempting to use the HttpClient. I read some articles

  • 0

im in .Net 4.0 and attempting to use the HttpClient. I read some articles saying that it was no longer supported in 4.0 but that you could still use it? i’ve included the System.Net.Http; assembly but it’s not allowing me to provide the necessary params to the HttpClient. Any idea how I could fix this?

I’ve bolded where the errors are occuring.

using (HttpClient http = new **HttpClient("{0}/v1/dm/labels/{1}.xml", MI_API_URL**))
        {
            http.**TransportSettings**.Credentials = new NetworkCredential(apiusername, apipassword);

            List<KeyValuePair<string, string>> parms = new List<KeyValuePair<string, string>>();
            parms.Add(new KeyValuePair<string, string>("Status", "Wiped"));

            HttpResponseMessage response = http.**Get**(new Uri("devices.xml", UriKind.Relative), parms);
            response.EnsureStatusIsSuccessful();
            responseoutput = response.Content.ReadAsString();
            xdoc.LoadXml(responseoutput);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:49:04+00:00Added an answer on June 8, 2026 at 5:49 am

    As per MSDN HttpClient is supported only in .NET Framework 4.5. Nevertheless there is an implementation of HttpClient for .NET 4.0. You can download it here:

    HttpClient for .NET 4.0

    MSDN: HttpClient

    Still there are some differences in implementations. For example in version for .NET 4.0 there is no constructor w/ 2 parameters. Please see the source code for more information:

    HttpClient for .NET 4.0 source code

    Regarding your example:

    • There is no constructor w/ 2 params in impl. for .NET 4.0
    • There is no Get method w/ 2 params in impl. for .NET 4.0
    • There is no TransportSettings property in impl. for .NET 4.0
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use asp.net mvc's Action Result of File. So it would seem that
I am attempting to use Scintilla .NET in a project (I want a good
I am attempting to use ASP.NET MVC 4 beta together with JSON.NET. I'm using
I have been attempting to use ASP.NET MVC remote validation for username login access
We have a scenario where some .NET code is attempting to access the current
I'm attempting to implement OpenID with ASP.NET MVC (Yeah, we haven't heard that one
I am attempting to use the MapPageRoute feature in Visual Studio 2010 and .NET
Within the context of .NET 4 WCF, I am attempting to use the new
I've read about the ReSharper external sources feature in ReSharper 5. But when attempting
I am having a problem with code that worked fine in .NET 2.0 but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.