CurlParser.CSharp
0.1.170-PullRequest00020002
.NET 5.0
This package targets .NET 5.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.
This is a prerelease version of CurlParser.CSharp.
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 CurlParser.CSharp --version 0.1.170-PullRequest00020002
NuGet\Install-Package CurlParser.CSharp -Version 0.1.170-PullRequest00020002
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="CurlParser.CSharp" Version="0.1.170-PullRequest00020002" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CurlParser.CSharp --version 0.1.170-PullRequest00020002
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CurlParser.CSharp, 0.1.170-PullRequest00020002"
#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 CurlParser.CSharp as a Cake Addin #addin nuget:?package=CurlParser.CSharp&version=0.1.170-PullRequest00020002&prerelease // Install CurlParser.CSharp as a Cake Tool #tool nuget:?package=CurlParser.CSharp&version=0.1.170-PullRequest00020002&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CurlParser.CSharp
A cURL parser and C# code converter based on curl-to-csharp project for .NET Core.
Supported platforms:
- For ASP.NET Core 5, .NET 5
- For ASP.NET Core 3, .NET Core 3.0
Key Features
- Parse cURL command into C# code.
- Convert output from CurlParser into C# code.
- Return parsing errors and warnings if the cURL input is invalid.
Installation
Install with NuGet
dotnet add package CurlParser.CSharp
Usage/Examples
var input = @"curl https://sentry.io/api/0/projects/1/groups/?status=unresolved -d '{""status"": ""resolved""}' -H 'Content-Type: application/json' -u 'username:password' -H 'Accept: application/json' -H 'User-Agent: curl/7.60.0'";
var output = new Converter().Parse(input, 10);
Console.WriteLine(output.Data);
// Output:
/*
// In production code, don't destroy the HttpClient through using, but better reuse an existing instance
// https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://sentry.io/api/0/projects/1/groups/?status=unresolved"))
{
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("User-Agent", "curl/7.60.0");
var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"));
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
request.Content = new StringContent("{\"status\": \"resolved\"}");
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
var response = await httpClient.SendAsync(request);
}
}
*/
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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 | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- CurlParser (>= 0.1.170-PullRequest00020002)
- Microsoft.CodeAnalysis.CSharp (>= 4.0.1)
-
net5.0
- CurlParser (>= 0.1.170-PullRequest00020002)
- Microsoft.CodeAnalysis.CSharp (>= 4.0.1)
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.0.0 | 5,630 | 11/24/2021 | |
0.1.203 | 5,285 | 11/23/2021 | |
0.1.170 | 4,723 | 11/24/2021 | |
0.1.170-PullRequest00020002 | 4,652 | 11/24/2021 | |
0.1.169 | 6,033 | 11/24/2021 |