v1.0.0
Content Types API
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
{
"name": "John Doe",
"age": 30,
"email": "john@example.com"
}
Responses
Successful responseSchema JSON JSON
application/json
{
"id": 123,
"name": "John Doe",
"status": "success",
"timestamp": "2023-06-07T14:30:00Z"
}
Form URL Encoded Content Type
POST
/form
Example of a request with form URL encoded content type.
Request Body
object
username
string
Required
password
string
Required
Format
password
remember
boolean
Responses
Successful responseSchema JSON JSON
application/json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}
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
object
file
string
Required
File to upload
Format
binary
description
string
category
string
Valid values
avatar
document
other
Responses
File uploaded successfullySchema JSON JSON
application/json
{
"file_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"file_name": "profile.jpg",
"file_size": 1024000,
"file_url": "https://example.com/files/f47ac10b-58cc-4372-a567-0e02b2c3d479"
}