Skip to content

Commit 6d886d5

Browse files
aminamin
amin
authored and
amin
committed
changes on Readme file
1 parent c317c83 commit 6d886d5

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

README.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ It's easy to use. just you should install the package on your project from the b
1717
You have **3 ways** to see script result:
1818

1919
**1: Show to the IDE Console**
20-
(e.g. **httpClient.GenerateCurlInConsole(httpRequestMessage, requestUri, null);** )
20+
(e.g. **httpClient.GenerateCurlInConsole(httpRequestMessage, requestUri, null);**)
2121

2222
- **Notice**: when the curl script was written in the console, maybe your **IDE console** applies **WordWrap** automatically. you should **remove enters** from the script.
2323

2424
**2: Write in a File**
25-
(e.g. **httpClient.GenerateCurlInFile(httpRequestMessage, requestUri, null);** )
25+
(e.g. **httpClient.GenerateCurlInFile(httpRequestMessage, requestUri, null);**)
2626

2727
**3: Put it in a String Variable.**
28-
(e.g. **string curlResult = httpClient.GenerateCurlInString(httpRequestMessage, requestUri, null);** )
28+
(e.g. **string curlResult = httpClient.GenerateCurlInString(httpRequestMessage, requestUri, null);**)
2929

3030

3131
- **Notice**: Parameters of 'requestUri' and 'config' for both of them are optional.
@@ -46,13 +46,13 @@ If you like this project, learn something or you are using it in your applicatio
4646
### **Post Method** sample code (it will be written in the **console**):
4747
```
4848
string requestBody = @"{""name"":""amin"",""requestId"":""10001000"",""amount"":10000}";
49-
string requestUri = "api/test";
49+
string requestUri = "/api/test";
5050
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, requestUri);
5151
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
5252
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
5353
5454
using var httpClient = new HttpClient();
55-
httpClient.BaseAddress = new Uri("http://localhost:1213");
55+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
5656
5757
httpClient.GenerateCurlInConsole(
5858
httpRequestMessage,
@@ -70,7 +70,7 @@ If you like this project, learn something or you are using it in your applicatio
7070
### **Post Method** sample code for FormUrlEncodedContent (it will be written in the **console**):
7171
```
7272
string requestBody = @"{""name"":""justin"",""requestId"":10001026,""amount"":26000}";
73-
string requestUri = "api/test";
73+
string requestUri = "/api/test";
7474
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, requestUri);
7575
httpRequestMessage.Content = new FormUrlEncodedContent(new[]
7676
{
@@ -80,7 +80,7 @@ If you like this project, learn something or you are using it in your applicatio
8080
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
8181
8282
using var httpClient = new HttpClient();
83-
httpClient.BaseAddress = new Uri("http://localhost:1213");
83+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
8484
8585
httpClient.GenerateCurlInConsole(
8686
httpRequestMessage,
@@ -108,12 +108,12 @@ If you like this project, learn something or you are using it in your applicatio
108108
<amount>240000</amount>
109109
</Order>";
110110
111-
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, "api/test");
111+
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, "/api/test");
112112
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
113113
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
114114
115115
using var httpClient = new HttpClient();
116-
httpClient.BaseAddress = new Uri("http://localhost:1213");
116+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
117117
118118
httpClient.GenerateCurlInConsole(
119119
httpRequestMessage,
@@ -136,13 +136,13 @@ If the filename variable is null or empty, then the current date will be set for
136136
string path = string.Empty;
137137
string filename = "PostMethodResult" ;
138138
string requestBody = @"{""name"":""sara"",""requestId"":""10001001"",""amount"":20000}";
139-
string requestUri = "api/test";
139+
string requestUri = "/api/test";
140140
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, requestUri);
141141
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
142142
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
143143
144144
using var httpClient = new HttpClient();
145-
httpClient.BaseAddress = new Uri("http://localhost:1213");
145+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
146146
147147
httpClient.GenerateCurlInFile(
148148
httpRequestMessage,
@@ -160,13 +160,13 @@ If the filename variable is null or empty, then the current date will be set for
160160

161161
### **Get Method** sample code (it will be written in the **console**):
162162
```
163-
string requestUri = "api/test";
163+
string requestUri = "/api/test";
164164
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
165165
httpRequestMessage.Content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
166166
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
167167
168168
using var httpClient = new HttpClient();
169-
httpClient.BaseAddress = new Uri("http://localhost:1213");
169+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
170170
171171
httpClient.GenerateCurlInConsole(
172172
httpRequestMessage,
@@ -189,13 +189,13 @@ If the filename variable is null or empty, then the current date will be set for
189189
```
190190
string path = string.Empty;
191191
string filename = "GetMethodResult";
192-
string requestUri = "api/test";
192+
string requestUri = "/api/test";
193193
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
194194
httpRequestMessage.Content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
195195
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
196196
197197
using var httpClient = new HttpClient();
198-
httpClient.BaseAddress = new Uri("http://localhost:1213");
198+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
199199
200200
httpClient.GenerateCurlInFile(
201201
httpRequestMessage,
@@ -214,13 +214,13 @@ If the filename variable is null or empty, then the current date will be set for
214214
### **Put Method** sample code (it will be written in the **console**):
215215
```
216216
string requestBody = @"{""name"":""jadi"",""requestId"":""10001003"",""amount"":30000}";
217-
string requestUri = "api/test";
217+
string requestUri = "/api/test";
218218
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, requestUri);
219219
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
220220
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
221221
222222
using var httpClient = new HttpClient();
223-
httpClient.BaseAddress = new Uri("http://localhost:1213");
223+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
224224
225225
httpClient.GenerateCurlInConsole(
226226
httpRequestMessage,
@@ -244,13 +244,13 @@ If the filename variable is null or empty, then the current date will be set for
244244
string path = string.Empty;
245245
string filename = "PutMethodResult" ;
246246
string requestBody = @"{ ""name"" : ""reza"",""requestId"" : ""10001004"",""amount"":40000 }";
247-
string requestUri = "api/test";
247+
string requestUri = "/api/test";
248248
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Put, requestUri);
249249
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
250250
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
251251
252252
using var httpClient = new HttpClient();
253-
httpClient.BaseAddress = new Uri("http://localhost:1213");
253+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
254254
255255
httpClient.GenerateCurlInFile(
256256
httpRequestMessage,
@@ -269,13 +269,13 @@ If the filename variable is null or empty, then the current date will be set for
269269
### **Patch Method** sample code (it will be written in the **console**):
270270
```
271271
string requestBody = @"{""name"":""hamed"",""requestId"":""10001005"",""amount"":50000}";
272-
string requestUri = "api/test";
272+
string requestUri = "/api/test";
273273
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Patch, requestUri);
274274
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
275275
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
276276
277277
using var httpClient = new HttpClient();
278-
httpClient.BaseAddress = new Uri("http://localhost:1213");
278+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
279279
280280
httpClient.GenerateCurlInConsole(
281281
httpRequestMessage,
@@ -299,13 +299,13 @@ If the filename variable is null or empty, then the current date will be set for
299299
string path = string.Empty;
300300
string filename = "PatchMethodResult" ;
301301
string requestBody = @"{ ""name"" : ""zara"",""requestId"" : ""10001006"",""amount"":60000 }";
302-
string requestUri = "api/test";
302+
string requestUri = "/api/test";
303303
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Patch, requestUri);
304304
httpRequestMessage.Content = new StringContent(requestBody, Encoding.UTF8, "application/json");
305305
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
306306
307307
using var httpClient = new HttpClient();
308-
httpClient.BaseAddress = new Uri("http://localhost:1213");
308+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
309309
310310
httpClient.GenerateCurlInFile(
311311
httpRequestMessage,
@@ -324,13 +324,13 @@ If the filename variable is null or empty, then the current date will be set for
324324
### **Delete Method** sample code (it will be written in the **console**):
325325
```
326326
int id = 12;
327-
string requestUri = $"api/test/{id}";
327+
string requestUri = $"/api/test/{id}";
328328
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, requestUri);
329329
httpRequestMessage.Content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
330330
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
331331
332332
using var httpClient = new HttpClient();
333-
httpClient.BaseAddress = new Uri("http://localhost:1213");
333+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
334334
335335
httpClient.GenerateCurlInConsole(
336336
httpRequestMessage,
@@ -354,13 +354,13 @@ If the filename variable is null or empty, then the current date will be set for
354354
string path = string.Empty;
355355
string filename = "DeleteMethodResult";
356356
int id = 12;
357-
string requestUri = $"api/test/{id}";
357+
string requestUri = $"/api/test/{id}";
358358
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, requestUri);
359359
httpRequestMessage.Content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
360360
httpRequestMessage.Headers.Add("Authorization", $"Bearer {Guid.NewGuid().ToString()}");
361361
362362
using var httpClient = new HttpClient();
363-
httpClient.BaseAddress = new Uri("http://localhost:1213");
363+
httpClient.BaseAddress = new Uri("http://localhost:1213/v1");
364364
365365
httpClient.GenerateCurlInFile(
366366
httpRequestMessage,

0 commit comments

Comments
 (0)