Merge pull request #553 from pmysl/body-serialization-fix

pl-api: fix request body serialization for formData and bodiless requests
This commit is contained in:
nicole mikołajczyk
2026-03-19 10:53:15 +01:00
committed by GitHub

View File

@@ -116,7 +116,7 @@ function request<T = any>(
if (!formData) headers.set('Content-Type', contentType);
if (idempotencyKey) headers.set('Idempotency-Key', idempotencyKey);
body = body && contentType === '' ? serialize(body, { indices: true }) : JSON.stringify(body);
body = body && formData ? serialize(body, { indices: true }) : JSON.stringify(body);
// Fetch API doesn't report upload progress, use XHR
if (onUploadProgress) {