Table of Contents

CurlDotNet API Reference

Welcome to the CurlDotNet API documentation. This reference contains detailed information about all public types and members in CurlDotNet.

Main Entry Points

Curl Class

The primary class for executing curl commands. Provides static methods for executing curl commands directly.

var response = await Curl.ExecuteAsync("curl https://api.github.com");

DotNetCurl Class

Alternative entry point that provides a more .NET-style API while maintaining curl compatibility.

Core Namespace

CurlDotNet.Core

Core functionality including:

Exception Handling

CurlDotNet.Exceptions

Comprehensive exception types for all curl error codes:

Middleware

CurlDotNet.Middleware

Extensible middleware pipeline for request/response processing:

Quick Examples

Simple GET Request

var result = await Curl.ExecuteAsync("curl https://api.example.com/data");
Console.WriteLine(result.Body);

POST with JSON

var result = await Curl.ExecuteAsync(@"
    curl -X POST https://api.example.com/users \
    -H 'Content-Type: application/json' \
    -d '{""name"":""John"",""email"":""john@example.com""}'
");

With Authentication

var result = await Curl.ExecuteAsync(@"
    curl -u username:password https://api.example.com/protected
");

See Also