fix: update request body handling in POST and PUT methods to accept raw data
This commit is contained in:
@@ -234,10 +234,11 @@ class ApiClient {
|
|||||||
if (!options.headers['Content-Type']) {
|
if (!options.headers['Content-Type']) {
|
||||||
options.headers['Content-Type'] = 'application/json'
|
options.headers['Content-Type'] = 'application/json'
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.request(endpoint, {
|
return this.request(endpoint, {
|
||||||
...options,
|
options: { ...options },
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: data ? JSON.stringify(data) : undefined,
|
body: data ? data : undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +250,7 @@ class ApiClient {
|
|||||||
return this.request(endpoint, {
|
return this.request(endpoint, {
|
||||||
...options,
|
...options,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: data ? JSON.stringify(data) : undefined,
|
body: data ? data : undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user