Skip to content

Commit 817f891

Browse files
committed
enhance: add Content-Type to OpenAI request headers
1 parent ab54ece commit 817f891

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Models/OpenAI.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public static OpenAIChatResponse Chat(string prompt, string question, Cancellati
105105
chat.AddMessage("user", question);
106106

107107
var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(60) };
108+
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
108109
if (!string.IsNullOrEmpty(ApiKey))
109110
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}");
110111

0 commit comments

Comments
 (0)