From 817f8919fd42fa06fbd581141be5937971a31a51 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 13 Sep 2024 20:50:11 +0800 Subject: [PATCH] enhance: add `Content-Type` to OpenAI request headers --- src/Models/OpenAI.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index 3f2acc0a..192459c7 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -105,6 +105,7 @@ namespace SourceGit.Models chat.AddMessage("user", question); var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(60) }; + client.DefaultRequestHeaders.Add("Content-Type", "application/json"); if (!string.IsNullOrEmpty(ApiKey)) client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}");