diff --git a/lib/js-api/src/superagentHttpClient.ts b/lib/js-api/src/superagentHttpClient.ts index e201067deb..a47130d2aa 100644 --- a/lib/js-api/src/superagentHttpClient.ts +++ b/lib/js-api/src/superagentHttpClient.ts @@ -176,12 +176,12 @@ export class SuperagentHttpClient implements HttpClient { if (contentType && contentType !== 'multipart/form-data') { request.type(contentType); - } else if (!(request as any).header['Content-Type'] && contentType !== 'multipart/form-data') { + } else if (!request.header['Content-Type'] && contentType !== 'multipart/form-data') { request.type('application/json'); } if (contentType === 'application/x-www-form-urlencoded') { - request.send(SuperagentHttpClient.normalizeParams(formParams)).on('progress', (event: any) => { + request.send(SuperagentHttpClient.normalizeParams(formParams)).on('progress', (event) => { this.progress(event, eventEmitter); }); } else if (contentType === 'multipart/form-data') {