diff --git a/src/common/lib/client/rest.ts b/src/common/lib/client/rest.ts index 409d0b6f40..c61c22215d 100644 --- a/src/common/lib/client/rest.ts +++ b/src/common/lib/client/rest.ts @@ -210,31 +210,23 @@ export class Rest { if (this.client.options.headers) Utils.mixin(headers, this.client.options.headers); const requestBody = Utils.encodeBody(requestBodyDTO, this.client._MsgPack, format); - Resource.post( - this.client, - '/messages', - requestBody, - headers, - { newBatchResponse: 'true' }, - null, - (err, body, headers, unpacked) => { - if (err) { - callback(err); - return; - } + Resource.post(this.client, '/messages', requestBody, headers, {}, null, (err, body, headers, unpacked) => { + if (err) { + callback(err); + return; + } - const batchResults = ( - unpacked ? body : Utils.decodeBody(body, this.client._MsgPack, format) - ) as BatchPublishResult[]; + const batchResults = ( + unpacked ? body : Utils.decodeBody(body, this.client._MsgPack, format) + ) as BatchPublishResult[]; - // I don't love the below type assertions for `callback` but not sure how to avoid them - if (singleSpecMode) { - (callback as StandardCallback)(null, batchResults[0]); - } else { - (callback as StandardCallback)(null, batchResults); - } + // I don't love the below type assertions for `callback` but not sure how to avoid them + if (singleSpecMode) { + (callback as StandardCallback)(null, batchResults[0]); + } else { + (callback as StandardCallback)(null, batchResults); } - ); + }); } batchPresence(channels: string[]): Promise; @@ -257,7 +249,7 @@ export class Rest { this.client, '/presence', headers, - { newBatchResponse: 'true', channels: channelsParam }, + { channels: channelsParam }, null, (err, body, headers, unpacked) => { if (err) { @@ -304,7 +296,7 @@ export class Rest { `/keys/${keyName}/revokeTokens`, requestBody, headers, - { newBatchResponse: 'true' }, + {}, null, (err, body, headers, unpacked) => { if (err) {