Test page
Body
inputintegerOptionalExample:
5
Responses
200
Successfully multiplied the input by 2
application/json
400
Invalid input. Input must be an integer.
application/json
post
import requests
url = "http://api.example.com/multiply"
payload = {"input": 5}
response = requests.post(url, json=payload)
if response.status_code == 200:
result = response.json().get("result")
print(f"Result: {result}")
else:
print(f"Error: {response.json().get('error')}")
{
"result": 10
}
Body
inputintegerOptionalExample:
5
Responses
200
Successfully multiplied the input by 2
application/json
400
Invalid input. Input must be an integer.
application/json
post
POST /multiply HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 11
{
"input": 5
}
{
"result": 10
}
Last updated