MCPcopy Create free account
hub / github.com/ShaanCoding/makeread.me / getRequestBody

Function getRequestBody

frontend/openAPI/generated/core/request.ts:182–193  ·  view source on GitHub ↗
(options: ApiRequestOptions)

Source from the content-addressed store, hash-verified

180};
181
182export const getRequestBody = (options: ApiRequestOptions): any => {
183 if (options.body !== undefined) {
184 if (options.mediaType?.includes('/json')) {
185 return JSON.stringify(options.body)
186 } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
187 return options.body;
188 } else {
189 return JSON.stringify(options.body);
190 }
191 }
192 return undefined;
193};
194
195export const sendRequest = async (
196 config: OpenAPIConfig,

Callers 1

requestFunction · 0.85

Calls 3

isStringFunction · 0.85
isBlobFunction · 0.85
isFormDataFunction · 0.85

Tested by

no test coverage detected