Skip to content

Commit 06ea42d

Browse files
committed
🐛 Force responseType 'text' for delete and head req. methods
1 parent 3432a55 commit 06ea42d

File tree

1 file changed

+22
-2
lines changed
  • packages/@ackee/antonio-core/src/modules/core/models

1 file changed

+22
-2
lines changed

packages/@ackee/antonio-core/src/modules/core/models/Antonio.ts

+22-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,31 @@ class Antonio {
4444
}
4545

4646
delete(url: string, requestConfig?: RequestConfig) {
47-
return request('delete', url, undefined, requestConfig, this);
47+
return request(
48+
'delete',
49+
url,
50+
undefined,
51+
{
52+
...requestConfig,
53+
// TODO: Consider other option that jsut forcing it here.
54+
// Maybe, use different default configs for each req. method.
55+
responseType: 'text',
56+
},
57+
this,
58+
);
4859
}
4960

5061
head(url: string, requestConfig?: RequestConfig) {
51-
return request('head', url, undefined, requestConfig, this);
62+
return request(
63+
'head',
64+
url,
65+
undefined,
66+
{
67+
...requestConfig,
68+
responseType: 'text',
69+
},
70+
this,
71+
);
5272
}
5373

5474
options(url: string, requestConfig?: RequestConfig) {

0 commit comments

Comments
 (0)