File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
3
3
return getFormData(options.formData);
4
4
}
5
5
if (options.body) {
6
- if (options.bodyMediaType.includes('/json')) {
6
+ if (options.bodyMediaType? .includes('/json')) {
7
7
return JSON.stringify(options.body)
8
8
} else if (isString(options.body) || isBlob(options.body)) {
9
9
return options.body;
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
3
3
return getFormData(options.formData);
4
4
}
5
5
if (options.body) {
6
- if (options.bodyMediaType.includes('/json')) {
6
+ if (options.bodyMediaType? .includes('/json')) {
7
7
return JSON.stringify(options.body)
8
- } else if (isString(options.body) || isBlob (options.body)) {
8
+ } else if (isString(options.body) || isBinary (options.body)) {
9
9
return options.body;
10
10
} else {
11
11
return JSON.stringify(options.body);
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function getRequestBody(options: ApiRequestOptions): any {
3
3
return getFormData(options.formData);
4
4
}
5
5
if (options.body) {
6
- if (options.bodyMediaType.includes('/json')) {
6
+ if (options.bodyMediaType? .includes('/json')) {
7
7
return JSON.stringify(options.body)
8
8
} else if (isString(options.body) || isBlob(options.body)) {
9
9
return options.body;
You can’t perform that action at this time.
0 commit comments