1

I need use httpclient

I install nuget package - Microsoft.Net.Http

after I see in reference - Microsoft.Net.Http

but when I try add using:

using Microsoft.Net.Http;

visual studio say, that have only Microsoft.Win32

I try restart vs and rebuild and nothing.

2 Answers 2

3

Every class has a namespace. For HttpClient the namespace is System.Net.Http.HttpClient. To use HttpClient in your application you need:

using System.Net.Http;

Very often the Classes inside the nuget package will have a namespace that starts with the nuget package name, but that is not a requirement. In this case its different.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks!!! before I try add this reference vithout install nuget package, but in code not see httpclient
1

Everything other than "System.*" needs to be reffered to somehow.

In this case its a nugget package.

Click here for refference

1 Comment

thanks, but if need for Android and need httpclient?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.