Reverting. Actually this is better.
This commit is contained in:
parent
612a658b77
commit
5a1efa90c7
@ -72,13 +72,13 @@ namespace MontoyaTech.Rest.Net
|
||||
writer.WriteBreak().WriteLine("public static void Init(string baseUrl)").WriteLine("{").Indent();
|
||||
|
||||
//Init the base url
|
||||
writer.WriteLine("BaseUrl = baseUrl;");
|
||||
writer.WriteLine($"{this.ClientName}.BaseUrl = baseUrl;");
|
||||
|
||||
//Init the http client
|
||||
writer.WriteLine("HttpClient = new HttpClient();");
|
||||
writer.WriteLine(@"HttpClient.DefaultRequestHeaders.Add(""Accept"", ""*/*"");");
|
||||
writer.WriteLine(@"HttpClient.DefaultRequestHeaders.Add(""Connection"", ""keep-alive"");");
|
||||
writer.WriteLine(@"HttpClient.DefaultRequestHeaders.Add(""Accept-Encoding"", ""identity"");");
|
||||
writer.WriteLine($"{this.ClientName}.HttpClient = new HttpClient();");
|
||||
writer.WriteLine(@$"{this.ClientName}.HttpClient.DefaultRequestHeaders.Add(""Accept"", ""*/*"");");
|
||||
writer.WriteLine(@$"{this.ClientName}.HttpClient.DefaultRequestHeaders.Add(""Connection"", ""keep-alive"");");
|
||||
writer.WriteLine(@$"{this.ClientName}.HttpClient.DefaultRequestHeaders.Add(""Accept-Encoding"", ""identity"");");
|
||||
|
||||
writer.Outdent().WriteLine("}");
|
||||
}
|
||||
@ -301,7 +301,7 @@ namespace MontoyaTech.Rest.Net
|
||||
}
|
||||
|
||||
if (this.StaticCode)
|
||||
writer.WriteSeparator().Write('$').Write('"').Write("{BaseUrl}");
|
||||
writer.WriteSeparator().Write('$').Write('"').Write("{Client.BaseUrl}");
|
||||
else
|
||||
writer.WriteSeparator().Write('$').Write('"').Write("{this.Client.BaseUrl}");
|
||||
|
||||
@ -346,7 +346,7 @@ namespace MontoyaTech.Rest.Net
|
||||
|
||||
//Generate the response code
|
||||
if (this.StaticCode)
|
||||
writer.WriteBreak().WriteLine("var response = HttpClient.Send(message);");
|
||||
writer.WriteBreak().WriteLine("var response = Client.HttpClient.Send(message);");
|
||||
else
|
||||
writer.WriteBreak().WriteLine("var response = this.Client.HttpClient.Send(message);");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user