Create Route
To create the object, the full route needs to be provided. Optional data will be filled with defaults or left empty.
To create a new route, you need to use the following Cloud API POST request:
POST /gateways/{apigatewayId}/routes
Request
curl -X 'POST' \
'https://apigateway.de-txl.ionos.com/gateways/0620c174-dd3c-5eb4-87c8-e2b516553a00/routes' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {},
"properties": {
"name": "example-route",
"type": "http",
"paths": [
"/foo/*",
"/bar"
],
"methods": [
"GET",
"POST"
],
"websocket": false,
"upstreams": [
{
"scheme": "http",
"loadbalancer": "roundrobin",
"host": "www.example.com",
"port": 80,
"weight": 100
}
]
}
}'Response
201 Route successfully created
Last updated
Was this helpful?