Libcat.Http 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Libcat.Http --version 1.0.1
NuGet\Install-Package Libcat.Http -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Libcat.Http" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Libcat.Http --version 1.0.1
#r "nuget: Libcat.Http, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Libcat.Http as a Cake Addin
#addin nuget:?package=Libcat.Http&version=1.0.1

// Install Libcat.Http as a Cake Tool
#tool nuget:?package=Libcat.Http&version=1.0.1

Libcat.Http

  • A very simple & light http library. You can do get/post requests easily with this lib.
  • Only frequently used functions included (but enough at most time),such as get/post.
  • There is no need to warry about most of the annoying system apis, parametres, certificates, byte arrays, encodings, etc.

Code structure (Classes)

  • HttpRequest: important parametres of one request; methods to do the request, and methods to process the response.
  • HttpResult: Response text/html,status code(200,404,...), etc.
  • Tools: some useful tools, such as get timestamp, url decoding, and so on.

How to do a GET/POST request ?

Normal way

var request=new HttpRequest("http://www.google.com/");  //create a request
var result=request.GetResponse();

Console.WriteLine(result.Html);
Console.WriteLine(result.StatusCodeNum);

Set request headers like this

request.CookieContainer=myCookieContainer;
request.referer="https://www.youtube.com";
request.TimeOut=1000;
//discover by yourself!

Simple way

var result=HttpRequest.Get("http://www.google.com/");
var result=HttpRequest.Post("http://www.google.com/","id=123&password=456");
//discover by yourself!

Features

  • Automaticly update cookiecontainer (set request.CookieContainer=yourContainer)
  • 6 versions of Get method, 2 versions of Post method
  • Support RESTful api partly (set request.Method=GET/POST/DELETE)
  • Discover by yourself, I need sleep urgently.

Future plan

Now this project is just a preview version, I make it in one day (some parts of it are written by others, without a liscense)
And I did not fully test it. God knows how many bugs there are.

Here are my plan:

  • Fix bugs
  • Support async get/post methods
  • Support all RESTful api
  • Support download files and images (although you can download them in byte array now)

End

  • If you find any bug or have suggestions for me, raise issues.
  • I am not responsible for any problem caused by this lib (Libcat.http)

Thank you!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0-alpha1 558 12/1/2018
1.0.2 781 10/24/2018
1.0.1 700 10/1/2018
1.0.0 674 9/30/2018

修正目标平台的错误(x64->Any CPU)   Fix mistake of target platform(x64->Any CPU)