diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts index b98e7874..d221ec91 100644 --- a/ui/src/lib/api.ts +++ b/ui/src/lib/api.ts @@ -75,10 +75,13 @@ class ApiClient { private async apiFetch(endpoint: string, options: RequestInit = {}): Promise { const url = `${this.baseUrl}${endpoint}`; + // Only set Content-Type if there is a body + const contentType = options.body ? 'application/json' : ''; + const config: RequestInit = { ...options, headers: { - ...this.createHeaders(), + ...this.createHeaders(contentType), ...options.headers, }, };