You can configure HttpClient
to automatically pass credentials like this:
var myClient = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true });
More Related Contents:
- How to set custom JsonSerializerSettings for Json.NET in ASP.NET Web API?
- Specifying a custom DateTime format when serializing with Json.Net
- How do I set a cookie on HttpClient’s HttpRequestMessage
- How to add/update child entities when updating a parent entity in EF
- Dot character ‘.’ in MVC Web API 2 for request such as api/people/STAFF.45287
- Download file from an ASP.NET Web API method using AngularJS
- Failed to serialize the response in Web API with Json
- Unauthorised webapi call returning login page rather than 401
- Web API Put Request generates an Http 405 Method Not Allowed error
- ASP.NET Core MVC : How to get raw JSON bound to a string without a type?
- How can I use a reserved keyword as an identifier in my JSON model class?
- How to update a claim in ASP.NET Identity?
- 404 error after adding Web API to an existing MVC Web Application
- HTTP 404 Page Not Found in Web Api hosted in IIS 7.5
- catch all unhandled exceptions in ASP.NET Web Api
- Complex type is getting null in a ApiController parameter
- Token Based Authentication in ASP.NET Core (refreshed)
- Suppress properties with null value on ASP.NET Web API
- Route parameter with slash “/” in URL
- How to return a file using Web API?
- How to use System.Net.HttpClient to post a complex type?
- How to add Web API to an existing ASP.NET MVC (5) Web Application project?
- Web API optional parameters
- Simple JWT authentication in ASP.NET Core 1.0 Web API
- Why is this web api controller not concurrent?
- GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration
- Best practice for error handling with ASP.NET Web API
- Is there a way in Json.NET serialization to distinguish between “null because not present” and “null because null”?
- Request.Content.ReadAsMultipartAsync never returns
- What is the difference between DependencyResolver.SetResolver and HttpConfiguration.DependencyResolver in WebAPI