Removes redundant content-type header
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s
Removes the explicit setting of the "Content-Type" header, as HttpClient handles this automatically based on the content being sent. This change simplifies the code and avoids potential conflicts if the content type is already being set elsewhere.
This commit is contained in:
@@ -248,7 +248,6 @@ if (app.Environment.IsDevelopment())
|
||||
HttpClient client = httpClientFactory.CreateClient("InsecureClient");
|
||||
client.BaseAddress = new Uri("https://tesla_command_proxy");
|
||||
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {access_token}");
|
||||
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
|
||||
|
||||
//Get cars
|
||||
VehiclesEnvelope? vehiclesEnvelope = await client.GetFromJsonAsync<VehiclesEnvelope>("/api/1/vehicles");
|
||||
|
||||
Reference in New Issue
Block a user