You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,114 +14,120 @@ An extension for generating the **CURL script** from **`HttpClient`** and **`Htt
10
14
---
11
15
12
16
## 📖 Overview
13
-
**`HttpClientToCurl`** is a lightweight **.NET extension library** that helps you visualize any HTTP request as a **CURL command**.
14
17
15
-
You can use its extension methods on both:
18
+
**HttpClientToCurl** is a lightweight and powerful .NET extension library that turns your HTTP requests into **cURL** commands.
19
+
20
+
You can use its extension methods on:
16
21
-**`HttpClient`** — to generate CURL directly when sending requests
17
22
-**`HttpRequestMessage`** — to inspect or log CURL representations before sending
18
23
19
-
This is useful for:
20
-
- Debugging and verifying request payloads or headers
21
-
- Sharing API calls between teammates
22
-
- Generating or updating Postman collections easily
24
+
---
25
+
26
+
### 🧩 1. Automatic Mode
27
+
28
+
Automatically generates cURL output whenever your app sends a request.
29
+
You can configure it through dependency injection:
30
+
31
+
-**Global Registration** — enable for all `HttpClient` instances created via `IHttpClientFactory`
32
+
-**Per-Client Registration** — enable only for selected clients
33
+
34
+
**Best for:**
35
+
Logging, monitoring, or tracing outgoing requests across the application.
23
36
24
37
---
38
+
39
+
### 🧰 2. Manual Mode
40
+
41
+
Generate cURL commands **on demand** using extension methods on either `HttpClient` or `HttpRequestMessage`.
42
+
43
+
**Best for:**
44
+
Debugging individual requests, creating reproducible Postman calls, or sharing API examples.
45
+
46
+
---
47
+
48
+
### 💡 Why Use HttpClientToCurl?
49
+
50
+
- 🧪 Instantly visualize and debug request payloads or headers
51
+
- 🤝 Share exact API calls with teammates or QA engineers
52
+
- ⚙️ Simplify Postman and CLI reproduction
53
+
- 🪶 Lightweight, dependency-free, and easy to integrate
54
+
55
+
---
56
+
25
57
## ⚙️ Installation
26
58
59
+
Install via NuGet:
60
+
27
61
```bash
28
62
dotnet add package HttpClientToCurl
29
63
```
30
-
Or visit the NuGet page here: <ahref="https://www.nuget.org/packages/HttpClientToCurl"target="_blank">HttpClientToCurl</a>
31
-
32
-
## 📚 Documentation
33
64
34
-
For full examples, detailed usage, and advanced configuration options, please see the **Wiki**:
65
+
Or visit the [NuGet page →](https://www.nuget.org/packages/HttpClientToCurl)
35
66
36
-
👉 [Open Wiki → More Details](https://github.com/amingolmahalle/HttpClientToCurlGenerator/wiki)
37
-
38
-
## 🚀 **Usage Example**
39
-
40
-
### ⚡ Quick Usage
67
+
---
41
68
42
-
#### 1️⃣ Global Registration
69
+
##🚀 Quick Start
43
70
44
-
Enable cURL generation globally so that every `HttpClient` created through `IHttpClientFactory` automatically logs cURL commands before sending requests.
71
+
### 🔧 1️⃣ Global Registration
45
72
46
-
**Program.cs / Startup:**
73
+
Enable cURL generation globally — every `HttpClient` created through `IHttpClientFactory` will automatically log cURL commands.
0 commit comments