Discussions
Try It: Support for sending binary file in post body
4 months ago by Jimmy Zimmerman
I'm testing "Try It" capabilities for sending a file as post body. My OAS document has the following:
post:
...
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
The API Reference page provides a file selector for the request body, which works great, except that the body ends up formatted as a Base64 encoded string, which is not desired:
data:image/jpeg;name=Jimmy%20Zimmerman%20-%20profile.jpg;base64,/9j/4AAQSkZJRgABAQAASA...
Instead, the endpoint expects the data to be sent as raw binary data.
Am I missing something in the OAS document to define that the data should be binary data, not base64 encoded?