Hanson.Common.HttpUtils
1.0.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Hanson.Common.HttpUtils --version 1.0.0
NuGet\Install-Package Hanson.Common.HttpUtils -Version 1.0.0
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="Hanson.Common.HttpUtils" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hanson.Common.HttpUtils --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Hanson.Common.HttpUtils, 1.0.0"
#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 Hanson.Common.HttpUtils as a Cake Addin #addin nuget:?package=Hanson.Common.HttpUtils&version=1.0.0 // Install Hanson.Common.HttpUtils as a Cake Tool #tool nuget:?package=Hanson.Common.HttpUtils&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
README
Hanson.Common.HttpUtils
主要功能
- 提供 Http 基本功能
Url 路徑合併
讀取 URL 文字內容
下載 URL 檔案
前置條件
- 開發環境需具備 .Net 6.0 or .Net Core 3.1 or NET 472 or NET 462
- 運行於 Windows Platform (x86, x64)
- 運行於 Linux Platform (x86, x64)
- 運行於 OSX Platform (x64)
- 運行於 Raspberry PI Platform (x86)
安裝方式
- 採用 Nuget 方式進行安裝作業 https://www.nuget.org/packages/Hanson.Common.HttpUtils/
授權
此專案採用的 License為 Apache-2.0
使用範例
命名空間
using Hanson.Common.Utils;
- URL 合併範例
private void Sample()
{
var urlPath1 = @"http://127.0.0.1";
var subUrlPath = @"combine";
var htmlName = "index.html";
// 合併 URL
string url = HttpUtils.UrlCombine(urlPath1, subUrlPath, htmlName);
Console.WriteLine($"合併 URL - 執行結果: {url}");
}
- 內容讀取範例
private static async Task SampleAsync()
{
var url = @"https://www.google.com/";
// 讀取 URL 網頁內容
var content = await HttpUtils.GetUrlContentAsync(url);
Console.WriteLine($"讀取 URL - 執行結果: {content}");
}
- 檔案下載範例
private static async Task SampleAsync()
{
var path = @"c:\temp\index.html";
var url = @"https://www.google.com/";
// 下載 URL 檔案
var status = await HttpUtils.DownloadFileAsync(url, path);
Console.WriteLine($"下載執行結果: {status}");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 | netcoreapp3.1 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Hanson.NLog.Config (>= 1.1.0)
- System.Net.Http (>= 4.3.4)
-
.NETFramework 4.6.2
- Hanson.NLog.Config (>= 1.1.0)
- System.Net.Http (>= 4.3.4)
-
.NETFramework 4.7.2
- Hanson.NLog.Config (>= 1.1.0)
- System.Net.Http (>= 4.3.4)
-
net6.0
- Hanson.NLog.Config (>= 1.1.0)
- System.Net.Http (>= 4.3.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Hanson.Common.HttpUtils:
Package | Downloads |
---|---|
Hanson.AutoUpdater
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.