feat: support for binary body (#4466)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ export const knownContentTypes = {
|
||||
"text/xml": "xml",
|
||||
"application/x-www-form-urlencoded": "multipart",
|
||||
"multipart/form-data": "multipart",
|
||||
"application/octet-stream": "binary",
|
||||
"text/html": "html",
|
||||
"text/plain": "plain",
|
||||
}
|
||||
|
||||
@@ -41,6 +41,10 @@ export const HoppRESTReqBody = z.union([
|
||||
body: z.array(FormDataKeyValue).catch([]),
|
||||
showIndividualContentType: z.boolean().optional().catch(false),
|
||||
}),
|
||||
z.object({
|
||||
contentType: z.literal("application/octet-stream"),
|
||||
body: z.instanceof(File).nullable().catch(null),
|
||||
}),
|
||||
z.object({
|
||||
contentType: z.union([
|
||||
z.literal("application/json"),
|
||||
@@ -50,6 +54,7 @@ export const HoppRESTReqBody = z.union([
|
||||
z.literal("application/xml"),
|
||||
z.literal("text/xml"),
|
||||
z.literal("application/x-www-form-urlencoded"),
|
||||
z.literal("binary"),
|
||||
z.literal("text/html"),
|
||||
z.literal("text/plain"),
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user