@@ -74,7 +74,7 @@ string requestBody = @"{""name"":""amin"",""requestId"":""10001000"",""amount"":
7474string requestUri = " api/test" ;
7575var httpRequestMessage = new HttpRequestMessage (HttpMethod .Post , requestUri );
7676httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
77- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
77+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
7878
7979using var httpClient = new HttpClient ();
8080httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -96,16 +96,14 @@ httpClient.GenerateCurlInConsole(
9696string requestBody = @" {"" name"" :"" justin"" ,"" requestId"" :10001026,"" amount"" :26000}" ;
9797string requestUri = " api/test" ;
9898var httpRequestMessage = new HttpRequestMessage (HttpMethod .Post , requestUri );
99- httpRequestMessage .Content = new FormUrlEncodedContent (new []
99+ httpRequestMessage .Content = new FormUrlEncodedContent (new []
100100{
101101 new KeyValuePair <string , string >(" session" , " 703438f3-16ad-4ba5-b923-8f72cd0f2db9" ),
102102 new KeyValuePair <string , string >(" payload" , requestBody ),
103103});
104- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ().ToString ()}" );
105-
104+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid
106105using var httpClient = new HttpClient ();
107- httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
108-
106+ httpClient .BaseAddress = new Uri (" http://localhost:1213/v1
109107httpClient .GenerateCurlInConsole (
110108 httpRequestMessage ,
111109 config =>
@@ -131,7 +129,7 @@ string requestBody = @"<?xml version = ""1.0"" encoding = ""UTF-8""?>
131129
132130var httpRequestMessage = new HttpRequestMessage (HttpMethod .Post , " api/test" );
133131httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
134- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
132+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
135133
136134using var httpClient = new HttpClient ();
137135httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -148,44 +146,37 @@ httpClient.GenerateCurlInConsole(
148146// Call PostAsync => await client.PostAsync(requestUri, httpRequestMessage.Content);
149147 ```
150148
151- ### ** Post Method** sample code (it will be written in the ** file** ):
152-
153- If the path variable is null or empty, then the file is created in the ** root project** .
154-
155- If the filename variable is null or empty, then the current date will be set for it with this format: ** yyyyMMdd**
149+ ### **Get Method** sample code (it will be written in the **console**):
156150
157151```cs
158- string path = string .Empty ;
159- string filename = " PostMethodResult" ;
160- string requestBody = @" {"" name"" :"" sara"" ,"" requestId"" :"" 10001001"" ,"" amount"" :20000}" ;
161152string requestUri = " api/test" ;
162- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Post , requestUri );
163- httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
164- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
153+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Get , requestUri );
154+ httpRequestMessage .Content = new StringContent (string . Empty , Encoding .UTF8 , " application/json" );
155+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
165156
166157using var httpClient = new HttpClient ();
167158httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
168159
169- httpClient .GenerateCurlInFile (
160+ httpClient .GenerateCurlInConsole (
170161 httpRequestMessage ,
171162 config =>
172163 {
173- config .Filename = filename ;
174- config .Path = path ;
175164 config .TurnOn = true ;
176165 config .NeedAddDefaultHeaders = true ;
166+ config .EnableCodeBeautification = false ;
177167 });
178168
179- // Call PostAsync => await client.PostAsync (requestUri, httpRequestMessage.Content );
169+ // Call GetAsync => await client.GetAsync (requestUri);
180170 ```
181171
182- ### ** Get Method** sample code (it will be written in the ** console** ):
172+ ### **Put Method** sample code (it will be written in the **console**):
183173
184174```cs
175+ string requestBody = @" {"" name"" :"" jadi"" ,"" requestId"" :"" 10001003"" ,"" amount"" :30000}" ;
185176string requestUri = " api/test" ;
186- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Get , requestUri );
187- httpRequestMessage .Content = new StringContent (string . Empty , Encoding .UTF8 , " application/json" );
188- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
177+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Put , requestUri );
178+ httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
179+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
189180
190181using var httpClient = new HttpClient ();
191182httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -199,47 +190,41 @@ httpClient.GenerateCurlInConsole(
199190 config .EnableCodeBeautification = false ;
200191 });
201192
202- // Call GetAsync => await client.GetAsync (requestUri);
193+ // Call PutAsync => await client.PutAsync (requestUri, httpRequestMessage.Content );
203194 ```
204195
205- ### ** Get Method** sample code (it will be written in the ** file** ):
206-
207- If the path variable is null or empty, then the file is created in the ** root project** .
208-
209- If the filename variable is null or empty, then the current date will be set for it with this format: ** yyyyMMdd**
196+ ### **Patch Method** sample code (it will be written in the **console**):
210197
211198```cs
212- string path = string .Empty ;
213- string filename = " GetMethodResult" ;
199+ string requestBody = @" {"" name"" :"" hamed"" ,"" requestId"" :"" 10001005"" ,"" amount"" :50000}" ;
214200string requestUri = " api/test" ;
215- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Get , requestUri );
216- httpRequestMessage .Content = new StringContent (string . Empty , Encoding .UTF8 , " application/json" );
217- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
201+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Patch , requestUri );
202+ httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
203+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
218204
219205using var httpClient = new HttpClient ();
220206httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
221207
222- httpClient .GenerateCurlInFile (
208+ httpClient .GenerateCurlInConsole (
223209 httpRequestMessage ,
224210 config =>
225211 {
226- config .Filename = filename ;
227- config .Path = path ;
228212 config .TurnOn = true ;
229213 config .NeedAddDefaultHeaders = true ;
214+ config .EnableCodeBeautification = false ;
230215 });
231216
232- // Call GetAsync => await client.GetAsync (requestUri);
217+ // Call PatchAsync => await client.PatchAsync (requestUri, httpRequestMessage.Content );
233218 ```
234219
235- ### ** Put Method** sample code (it will be written in the ** console** ):
220+ ### **Delete Method** sample code (it will be written in the **console**):
236221
237222```cs
238- string requestBody = @" { "" name "" : "" jadi "" , "" requestId "" : "" 10001003 "" , "" amount "" :30000} " ;
239- string requestUri = " api/test" ;
240- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Put , requestUri );
241- httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
242- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
223+ int id = 12 ;
224+ string requestUri = $ " api/test/{ id } " ;
225+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Delete , requestUri );
226+ httpRequestMessage .Content = new StringContent (string . Empty , Encoding .UTF8 , " application/json" );
227+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
243228
244229using var httpClient = new HttpClient ();
245230httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -253,23 +238,23 @@ httpClient.GenerateCurlInConsole(
253238 config .EnableCodeBeautification = false ;
254239 });
255240
256- // Call PutAsync => await client.PutAsync (requestUri, httpRequestMessage.Content );
241+ // Call DeleteAsync => await client.DeleteAsync (requestUri);
257242 ```
258243
259- ### ** Put Method** sample code (it will be written in the ** file** ):
244+ ### **Post Method** sample code (it will be written in the **file**):
260245
261246If the path variable is null or empty , then the file is created in the **root project **.
262247
263248If the filename variable is null or empty , then the current date will be set for it with this format : ** yyyyMMdd **
264249
265250```cs
266251string path = string .Empty ;
267- string filename = " PutMethodResult " ;
268- string requestBody = @" { "" name"" : "" reza "" ,"" requestId"" : "" 10001004 "" ,"" amount"" :40000 }" ;
252+ string filename = " PostMethodResult " ;
253+ string requestBody = @" {"" name"" : "" sara "" ,"" requestId"" : "" 10001001 "" ,"" amount"" :20000 }" ;
269254string requestUri = " api/test" ;
270- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Put , requestUri );
255+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Post , requestUri );
271256httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
272- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
257+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
273258
274259using var httpClient = new HttpClient ();
275260httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -284,47 +269,53 @@ httpClient.GenerateCurlInFile(
284269 config .NeedAddDefaultHeaders = true ;
285270 });
286271
287- // Call PutAsync => await client.PutAsync (requestUri, httpRequestMessage.Content);
272+ // Call PostAsync => await client.PostAsync (requestUri, httpRequestMessage.Content);
288273 ```
289274
290- ### ** Patch Method** sample code (it will be written in the ** console** ):
275+ ### **Get Method** sample code (it will be written in the **file**):
276+
277+ If the path variable is null or empty , then the file is created in the **root project **.
278+
279+ If the filename variable is null or empty , then the current date will be set for it with this format : ** yyyyMMdd **
291280
292281```cs
293- string requestBody = @" {"" name"" :"" hamed"" ,"" requestId"" :"" 10001005"" ,"" amount"" :50000}" ;
282+ string path = string .Empty ;
283+ string filename = " GetMethodResult" ;
294284string requestUri = " api/test" ;
295- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Patch , requestUri );
296- httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
297- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
285+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Get , requestUri );
286+ httpRequestMessage .Content = new StringContent (string . Empty , Encoding .UTF8 , " application/json" );
287+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
298288
299289using var httpClient = new HttpClient ();
300290httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
301291
302- httpClient .GenerateCurlInConsole (
292+ httpClient .GenerateCurlInFile (
303293 httpRequestMessage ,
304294 config =>
305295 {
296+ config .Filename = filename ;
297+ config .Path = path ;
306298 config .TurnOn = true ;
307299 config .NeedAddDefaultHeaders = true ;
308- config .EnableCodeBeautification = false ;
309300 });
310301
311- // Call PatchAsync => await client.PatchAsync (requestUri, httpRequestMessage.Content );
302+ // Call GetAsync => await client.GetAsync (requestUri);
312303 ```
313304
314- ### ** Patch Method** sample code (it will be written in the ** file** ):
305+ ### **Put Method** sample code (it will be written in the **file**):
315306
316307If the path variable is null or empty , then the file is created in the **root project **.
317308
318309If the filename variable is null or empty , then the current date will be set for it with this format : ** yyyyMMdd **
319310
320311```cs
321312string path = string .Empty ;
322- string filename = " PatchMethodResult " ;
323- string requestBody = @" { "" name"" : "" zara "" ,"" requestId"" : "" 10001006 "" ,"" amount"" :60000 }" ;
313+ string filename = " PutMethodResult " ;
314+ string requestBody = @" { "" name"" : "" reza "" ,"" requestId"" : "" 10001004 "" ,"" amount"" :40000 }" ;
324315string requestUri = " api/test" ;
325- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Patch , requestUri );
316+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Put , requestUri );
326317httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
327- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
318+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
328319
329320using var httpClient = new HttpClient ();
330321httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
@@ -339,31 +330,38 @@ httpClient.GenerateCurlInFile(
339330 config .NeedAddDefaultHeaders = true ;
340331 });
341332
342- // Call PatchAsync => await client.PatchAsync (requestUri, httpRequestMessage.Content);
333+ // Call PutAsync => await client.PutAsync (requestUri, httpRequestMessage.Content);
343334 ```
344335
345- ### ** Delete Method** sample code (it will be written in the ** console** ):
336+ ### **Patch Method** sample code (it will be written in the **file**):
337+
338+ If the path variable is null or empty , then the file is created in the **root project **.
339+
340+ If the filename variable is null or empty , then the current date will be set for it with this format : ** yyyyMMdd **
346341
347342```cs
348- int id = 12 ;
349- string requestUri = $" api/test/{id }" ;
350- var httpRequestMessage = new HttpRequestMessage (HttpMethod .Delete , requestUri );
351- httpRequestMessage .Content = new StringContent (string .Empty , Encoding .UTF8 , " application/json" );
352- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ().ToString ()}" );
343+ string path = string .Empty ;
344+ string filename = " PatchMethodResult" ;
345+ string requestBody = @" { "" name"" : "" zara"" ,"" requestId"" : "" 10001006"" ,"" amount"" :60000 }" ;
346+ string requestUri = " api/test" ;
347+ var httpRequestMessage = new HttpRequestMessage (HttpMethod .Patch , requestUri );
348+ httpRequestMessage .Content = new StringContent (requestBody , Encoding .UTF8 , " application/json" );
349+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
353350
354351using var httpClient = new HttpClient ();
355352httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
356353
357- httpClient .GenerateCurlInConsole (
354+ httpClient .GenerateCurlInFile (
358355 httpRequestMessage ,
359356 config =>
360357 {
358+ config .Filename = filename ;
359+ config .Path = path ;
361360 config .TurnOn = true ;
362361 config .NeedAddDefaultHeaders = true ;
363- config .EnableCodeBeautification = false ;
364362 });
365363
366- // Call DeleteAsync => await client.DeleteAsync (requestUri);
364+ // Call PatchAsync => await client.PatchAsync (requestUri, httpRequestMessage.Content );
367365 ```
368366
369367### **Delete Method** sample code (it will be written in the **file**):
@@ -379,7 +377,7 @@ int id = 12;
379377string requestUri = $" api/test/{id }" ;
380378var httpRequestMessage = new HttpRequestMessage (HttpMethod .Delete , requestUri );
381379httpRequestMessage .Content = new StringContent (string .Empty , Encoding .UTF8 , " application/json" );
382- httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid (). ToString () }" );
380+ httpRequestMessage .Headers .Add (" Authorization" , $" Bearer {Guid .NewGuid ()}" );
383381
384382using var httpClient = new HttpClient ();
385383httpClient .BaseAddress = new Uri (" http://localhost:1213/v1/" );
0 commit comments