Is it necessary to add Microsoft.net.http? monoAndroid?

Asked

Viewed 36 times

0

I am trying to get my app to pass data through a web api. Try to put the Microsoft.net.http package on nugetPackage but it will backfire. If necessary, how do I fix it? The

  • Edit the question and put the error that is being presented, it is better to help you

1 answer

0


Yes, you need to add a package, but you are trying to add the wrong package.

The name of the package is System.Net.Http

1. Adding the package

  • Right-click on the References of your project and select the option Manage Nuget Pacakages...

inserir a descrição da imagem aqui

  • On the open screen, click on the tab Browse or Look for, typhoon system.net.http, click on the package shown in the image and then click on Install or Install.

inserir a descrição da imagem aqui

  • Once this is done, you can use the System.Net.Http library to make HTTP requests such as consuming an API.

2. Using the System.Net.Http library

  • To use this library, first add two using at the top of your class (only the first is required, but since you will consume a Web API, you can now add both because you will need):

inserir a descrição da imagem aqui

  • Once this is done, you can start creating the methods to consume the API you want. Below follows an example image and a link from an article that shows how to perform REST operations on a Web API.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.