Skip to content

Commit 4cd859f

Browse files
Update README.md
1 parent 2017397 commit 4cd859f

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ An extension for generating the **CURL script** from **`HttpClient`** and **`Htt
44
[![license](https://img.shields.io/github/license/amingolmahalle/HttpClientToCurlGenerator)](https://github.com/amingolmahalle/HttpClientToCurlGenerator/blob/master/LICENSE)
55
[![stars](https://img.shields.io/github/stars/amingolmahalle/HttpClientToCurlGenerator)](https://github.com/amingolmahalle/HttpClientToCurlGenerator/stargazers)
66
[![NuGet Version](https://img.shields.io/nuget/v/HttpClientToCurl.svg)](https://www.nuget.org/packages/HttpClientToCurl/)
7+
[![NuGet Downloads](https://img.shields.io/nuget/dt/HttpClientToCurl.svg?style=flat-square)](https://www.nuget.org/packages/HttpClientToCurl/)
78
![Build](https://github.com/amingolmahalle/HttpClientToCurlGenerator/actions/workflows/dotnet.yml/badge.svg)
89

910
---
@@ -12,39 +13,43 @@ An extension for generating the **CURL script** from **`HttpClient`** and **`Htt
1213
**`HttpClientToCurl`** is a lightweight **.NET extension library** that helps you visualize any HTTP request as a **CURL command**.
1314

1415
You can use its extension methods on both:
15-
- **`HttpClient`** — to generate cURL directly when sending requests
16-
- **`HttpRequestMessage`** — to inspect or log cURL representations before sending
16+
- **`HttpClient`** — to generate CURL directly when sending requests
17+
- **`HttpRequestMessage`** — to inspect or log CURL representations before sending
1718

1819
This is useful for:
1920
- Debugging and verifying request payloads or headers
2021
- Sharing API calls between teammates
2122
- Generating or updating Postman collections easily
2223

2324
---
24-
2525
## ⚙️ Installation
2626

2727
```bash
2828
dotnet add package HttpClientToCurl
2929
```
30-
3130
Or visit the NuGet page here: <a href="https://www.nuget.org/packages/HttpClientToCurl" target="_blank">HttpClientToCurl</a>
3231

32+
## 📚 Documentation
33+
34+
For full examples, detailed usage, and advanced configuration options, please see the **Wiki**:
35+
36+
👉 [Open Wiki → More Details](https://github.com/amingolmahalle/HttpClientToCurlGenerator/wiki)
37+
3338
## 🚀 **Usage Example**
3439
```csharp
3540
using var httpClient = new HttpClient();
3641
var baseAddress = new Uri("http://localhost:1213/v1/");
3742
client.BaseAddress = baseAddress;
38-
var request = new HttpRequestMessage(HttpMethod.Post, "api/test")
39-
{
40-
Content = new StringContent(@"{ ""name"": ""amin"" }", Encoding.UTF8, "application/json")
41-
};
43+
string requestBody = /*lang=json,strict*/ @"{""name"":""sara"",""requestId"":10001001,""amount"":20000}";
44+
HttpRequestMessage request = new(HttpMethod.Post, requestUri);
45+
request.Headers.Add("Authorization", "Bearer YourAccessToken");
46+
request.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
4247

4348
// Using the HttpClient extension:
4449
httpClient.GenerateCurlInConsole(request);
4550

4651
// Or using the HttpRequestMessage extension:
47-
string curlScript = request.GenerateCurlInString(baseAddress);
52+
request.GenerateCurlInConsole(baseAddress);
4853
```
4954

5055
## ✅ Output:
@@ -63,18 +68,11 @@ Supports **JSON**, **XML**, and **FormUrlEncodedContent**
6368

6469
**Console** / **String** / **File**
6570

66-
**See more details in the [Wiki](https://github.com/amingolmahalle/HttpClientToCurlGenerator/wiki) **
67-
6871
## 📚 Articles
6972

70-
### English Articles
7173
- [How to Generate cURL Script of the HttpClient in .NET](https://www.c-sharpcorner.com/article/how-to-generate-curl-script-of-the-httpclient-in-net/)
7274
- [New Feature in HttpClientToCurl for .NET: Debugging HttpRequestMessage Made Easy](https://medium.com/@mozhgan.etaati/new-feature-in-httpclienttocurl-for-net-debugging-httprequestmessage-made-easy-18cb66dd55f0)
7375

74-
### Persian Articles
75-
- [دریافت خروجی Curl از HttpClient در دات‌نت (.NET)](https://virgool.io/@amin.golmahalle/%D8%AF%D8%B1%DB%8C%D8%A7%D9%81%D8%AA-%D8%AE%D8%B1%D9%88%D8%AC%DB%8C-curl-%D8%A7%D8%B2-httpclient-%D8%AF%D8%B1-%D8%AF%D8%A7%D8%AA-%D9%86%D8%AA-vgamgtw2midt)
76-
- [دیباگ کردن HttpClient در دات‌نت (.NET)](https://virgool.io/@amin.golmahalle/%D8%AF%DB%8C%D8%A8%D8%A7%DA%AF-%DA%A9%D8%B1%D8%AF%D9%86-httpclient-%D8%AF%D8%B1-%D8%AF%D8%A7%D8%AA-%D9%86%D8%AA-net-jm0kcsmucrbk)
77-
7876

7977
## 💡 **Contribute**
8078

0 commit comments

Comments
 (0)