Skip to content

Example of an OpenAPI document with different content types for requests and responses.

Contact​

Servers​

https://api.example.com

JSON Content Type​

POST
/json

Example of a request and response with JSON content type.

Request Body​

application/json
Format"email"

Responses​

Successful response

application/json
Format"date-time"

Playground​

Body

Samples​


XML Content Type​

POST
/xml

Example of a request and response with XML content type.

Request Body​

application/xml

Responses​

Successful response

application/xml

Playground​

Body

Samples​


Form URL Encoded Content Type​

POST
/form

Example of a request with form URL encoded content type.

Request Body​

Format"password"

Responses​

Successful response

application/json

Playground​

Body

Samples​


Multipart Form Data Content Type​

POST
/multipart

Example of a request with multipart form data content type for file uploads.

Request Body​

multipart/form-data

File to upload

Format"binary"
Valid values"avatar""document""other"

Responses​

File uploaded successfully

application/json
Format"uri"

Playground​

Body

Samples​


Plain Text Content Type​

POST
/text

Example of a request and response with plain text content type.

Request Body​

text/plain

Responses​

Successful response

text/plain

Playground​

Body

Samples​


Upload Image​

POST
/image

Example of a request with image content type.

Request Body​

A PNG image

Format"binary"

Responses​

Image uploaded successfully

application/json
Format"uri"

Playground​

Body

Samples​


Powered by VitePress OpenAPI