H Hyien Member Jun 18, 2021 95 2 13 34 Jul 21, 2021 #1 how can i pass optional parameters to the rest API? eg. GET /api2/json//nodes/{node}/network this takes an optional 'type' parameter. how do i set this type parameter in a curl / wget query?
how can i pass optional parameters to the rest API? eg. GET /api2/json//nodes/{node}/network this takes an optional 'type' parameter. how do i set this type parameter in a curl / wget query?
t.lamprecht Proxmox Staff Member Staff member Jul 28, 2015 6,395 3,187 303 South Tyrol/Italy shop.proxmox.com Jul 21, 2021 #2 Hi, For GET parameters you can simply use GET query parameters, for example: Bash: curl https://pve.example.com:8006/api2/json/nodes/NODENAME/network?type=bridge -H 'Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID' For sending POST data one can use URL encoded form data, see https://pve.proxmox.com/wiki/Proxmox_VE_API#creates_an_lxc_container_.28with_the_given_parameters.29 for an example.
Hi, For GET parameters you can simply use GET query parameters, for example: Bash: curl https://pve.example.com:8006/api2/json/nodes/NODENAME/network?type=bridge -H 'Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID' For sending POST data one can use URL encoded form data, see https://pve.proxmox.com/wiki/Proxmox_VE_API#creates_an_lxc_container_.28with_the_given_parameters.29 for an example.