1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 21:30:05 +00:00

fix: new axios requires form data content type, es6 strict issues with iterations

This commit is contained in:
2025-03-07 10:36:43 +01:00
parent 008a9b4ca5
commit 4fb0b96f11
12 changed files with 478 additions and 374 deletions

View File

@@ -191,6 +191,13 @@ export class RequestClient implements HttpClient {
})
}
/**
* @param contentType Newer version of Axios is more strict so if you don't
* set the contentType to `form data` while sending a FormData object
* application/json will be used by default, axios wont treat it as FormData.
* Instead, it serializes data as JSON—resulting in a payload like
* {"sometable":{}} and we lose the multipart/form-data formatting.
*/
public async post<T>(
url: string,
data: any,