Skip to content

Commit 1679c35

Browse files
Mohit TejaniMohit Tejani
authored andcommitted
enahnce transport module for making http PUT requests, required for dataSync endpoints
1 parent dad9aca commit 1679c35

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/core/components/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export abstract class AbstractRequest<ResponseType, ServiceResponse extends obje
123123
if (headers) request.headers = headers;
124124

125125
// Attach body (if required).
126-
if (request.method === TransportMethod.POST || request.method === TransportMethod.PATCH) {
126+
if (request.method === TransportMethod.POST || request.method === TransportMethod.PATCH || request.method === TransportMethod.PUT) {
127127
const [body, formData] = [this.body, this.formData];
128128
if (formData) request.formData = formData;
129129
if (body) request.body = body;

src/core/types/transport-request.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export enum TransportMethod {
1919
* Request will be sent using `PATCH` method.
2020
*/
2121
PATCH = 'PATCH',
22+
/**
23+
* Request will be sent using `PUT` method.
24+
*/
25+
PUT = 'PUT',
2226
/**
2327
* Request will be sent using `DELETE` method.
2428
*/

0 commit comments

Comments
 (0)