Test page

Returns the input integer multiplied by 2

post
Body
inputintegerOptionalExample: 5
Responses
200
Successfully multiplied the input by 2
application/json
post
Python
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
}

Returns the input integer multiplied by 2

post
Body
inputintegerOptionalExample: 5
Responses
200
Successfully multiplied the input by 2
application/json
post
POST /multiply HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 11

{
  "input": 5
}
{
  "result": 10
}

Last updated