Improved the csharp client generator to check if the base url is null or whitespace and to remove trailing / characters. Fixed some bugs with different client names. Generator also now sets up cookie support.

This commit is contained in:
2023-02-07 13:02:56 -08:00
parent 6ae73aaa7d
commit 7ffa2d43ef
5 changed files with 325 additions and 120 deletions

View File

@ -40,6 +40,11 @@ namespace MontoyaTech.Rest.Net.Example
string code = listener.GenerateCSharpClient();
Console.WriteLine(code);
Console.WriteLine();
string staticCode = listener.GenerateCSharpClient("StaticClient", staticCode: true);
Console.WriteLine(staticCode);
listener.RequestPreProcessEvent += (HttpListenerContext context) => {
Console.WriteLine($"[{context.Request.HttpMethod}] Request start: " + context.Request.RawUrl);
@ -64,6 +69,10 @@ namespace MontoyaTech.Rest.Net.Example
var result = client.Auth.Get();
StaticClient.Init(listener.BaseUrl);
var result2 = StaticClient.Auth.Get();
listener.Block();
}