Forum Discussion
From the support docs:
Quotepost(url, payload, headers] do an HTTP POST to the provided url and return the entire response
string url – the target url
string payload – the post data payload
map headers – a map containing one or more HTTP POST headers
return string response – the entire HTTP response
It appears you want to pass a blank payload and add the X-Cisco-Meraki-API-Key header. In that case, you'll need to include a blank payload string:
import com.santaba.agent.groovyapi.http.* ip = "api-mp.meraki.com" url = "https://"+ip+"/api/v1/organizations/999999/appliance/vpn/statuses" key = hostProps.get("merakiAPIKey") httpClient = HTTP.open(ip, 443) def postResponse = httpClient.post(url,"",["X-Cisco-Meraki-API-Key":key])
I haven't checked this, so it'd remain to be verified, but this is at least how the docs indicate it should work. I've also reordered it to be more standard and to fetch the api key from the device property (assuming you're running this as a scripted LogicModule).
Related Content
- 9 months ago
- 2 years ago
- 11 months agoAnonymous