行業

CurlDotNet – 純.NET curl

CurlDotNet 是一個開源的 .NET 程式庫,讓開發者能夠直接在 C# 應用程式中貼上 curl 命令,無需手動翻譯。

Iron Software 自豪地贊助 CurlDotNet,以支持 .NET 開源社群。 由 Iron Software 的 CTO 和共同創辦人 Jacob Mellor 建立和維護。

快速開始

dotnet add package CurlDotNet
dotnet add package CurlDotNet
SHELL
using CurlDotNet;

// Paste any curl command directly from documentation
var result = await Curl.ExecuteAsync(
    "curl -X GET https://api.github.com/users/octocat -H 'Accept: application/json'"
);
using CurlDotNet;

// Paste any curl command directly from documentation
var result = await Curl.ExecuteAsync(
    "curl -X GET https://api.github.com/users/octocat -H 'Accept: application/json'"
);
Imports CurlDotNet

' Paste any curl command directly from documentation
Dim result = Await Curl.ExecuteAsync(
    "curl -X GET https://api.github.com/users/octocat -H 'Accept: application/json'"
)
$vbLabelText   $csharpLabel

為什麼選擇 CurlDotNet?

CurlDotNet 完全以 C# 實作,沒有任何依賴。 更重要的是,CurlDotNet 忠實地支持和保存了 cURL 的功能和語法。 這意味著:

  1. 易於使用 - 從 API 文件、Stack Overflow 或終端機複製和貼上 cURL 命令,並直接在 C# 程式中使用(無需翻譯成 HttpClient!)
  2. 快速遷移 - 以最小的努力從使用 bash 腳本處理 cURL 相關任務轉移到 C#
  3. 無學習曲線 - 熟悉 cURL 的開發者可以立即進入 CurlDotNet
  4. 功能齊全 - 訪問所有300+ cURL選項,輕鬆處理身份驗證、代理、重試和文件上傳!

資源: 文件| NuGet | GitHub