Slide 31
Slide 31 text
@stevejgordon
www.stevejgordon.co.uk
public class Startup
{
...
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient("github", client =>
{
client.BaseAddress = new Uri("https://api.github.com/");
client.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");
client.DefaultRequestHeaders.Add("User-Agent", "my-user-agent");
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{ … }
}