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:
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user