Xamarin.HttpConnection
1.0.4
dotnet add package Xamarin.HttpConnection --version 1.0.4
NuGet\Install-Package Xamarin.HttpConnection -Version 1.0.4
<PackageReference Include="Xamarin.HttpConnection" Version="1.0.4" />
paket add Xamarin.HttpConnection --version 1.0.4
#r "nuget: Xamarin.HttpConnection, 1.0.4"
// Install Xamarin.HttpConnection as a Cake Addin #addin nuget:?package=Xamarin.HttpConnection&version=1.0.4 // Install Xamarin.HttpConnection as a Cake Tool #tool nuget:?package=Xamarin.HttpConnection&version=1.0.4
HttpConnection
A shared Xamarin wrapper binding for HttpClient
Usage:
using Subsystems.HttpConnection.External;
...
...
Initialize
1. var httpConnectionProxy = new CMPHttpConnectionProxy();
httpConnectionProxy.URL("http://www.google.com").Build();
2. var httpClientProxy = new CMPHttpConnectionProxy();
httpClientProxy.URL($"<URL>")
.Headers("<Header_Key1>", "<Header_Value1>")
.Headers("<Header_Key2>", "<Header_Value2>")
.JsonBody("<Body_Key1>", "<Body_Value1>")
.JsonBody("<Body_Key2>", "<Body_Value2>")
.Build();
GetAsync
var httpResponse = await httpConnectionProxy.GetAsync();
Console.WriteLine(httpResponse.ResponseString);
PostAsync
var httpResponse = await httpConnectionProxy.PostAsync();
Console.WriteLine(httpResponse.ResponseString);
PutAsync
var httpResponse = await httpConnectionProxy.PutAsync();
Console.WriteLine(httpResponse.ResponseString);
DeleteAsync
var httpResponse = await httpConnectionProxy.DeleteAsync();
Console.WriteLine(httpResponse.ResponseString);
GetBytesWithProgressAsync
await cl.GetBytesWithProgressAsync((httpResponse, progressBytes, totalBytes) =>
{
responseString = string.Concat(responseString, httpResponse.ResponseString);
Console.WriteLine("Response:" + responseString);
Console.WriteLine("progressBytes: " + progressBytes + "\ntotalBytes: " + totalBytes);
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid81 is compatible. |
Xamarin.iOS | xamarinios10 is compatible. |
-
MonoAndroid 8.1
- Newtonsoft.Json (>= 11.0.2)
-
Xamarin.iOS 1.0
- Newtonsoft.Json (>= 11.0.2)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Xamarin.HttpConnection:
Package | Downloads |
---|---|
Xamarin.ImageLoader
A Reusable component to Download Image directly from URL. This also supportes Caching the downloaded images efficiently |
|
Xamarin.ShareQuick
A Xamarin wrapper around Xaamrin.Auth APIs to share in Social Media(Facebook & Twitter for now) |
|
Xamarin.CustomImageView.iOS
A custom ImageView component for iOS with inteligent Caching, Handle Cache expiry, Automatic Download |
|
Xamarin.CustomMapView.Droid
A Xamarin wrapper around Google Map APIs for Droid |
|
Xamarin.CustomMapView.iOS
A Xamarin wrapper around Google Map APIs for iOS |
GitHub repositories
This package is not used by any popular GitHub repositories.
Modified the name of GetContentsFromURL function to GetContentsFromURLAsync