addBear
POST
/bears
const url = 'https://example.com/api/bears';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","type":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/bears \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "type": "example" }'Creates a new bear
Request Body
Section titled “Request Body”Bear to add
Media typeapplication/json
One of: discriminator: type
white bear
object
name
string
type
string
brown bear
object
name
string
type
string
Examplegenerated
{ "name": "example", "type": "example"}Responses
Section titled “Responses”Animal response
Media typeapplication/json
object
name
required
string
tag
string
id
required
integer format: int64
Examplegenerated
{ "name": "example", "tag": "example", "id": 1}Headers
Section titled “Headers”X-Rate-Limit-Limit
integer format: int32
The number of allowed requests in the current period
X-Rate-Limit-Reset
integer format: int32
The number of seconds left in the current period
default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{ "code": 1, "message": "example"}