0

I'm trying to write a script in Groovy that makes an API request to check the status of VPN tunnels. I've been trying the implement the post() method from the HTTP library to update the header of the url with the API key. I keep running into an error "no signature on method". This is my code so far.

import com.santaba.agent.groovyapi.http.*;
ip = "api-mp.meraki.com";
httpClient = HTTP.open(ip, 443);
url = "https://"+ip+"/api/v1/organizations/999999/appliance/vpn/statuses";
def postResponse = httpClient.post(url,["X-Cisco-Meraki-API-Key":"ApiKey"]);

I just followed the example from this tutorial: https://www.logicmonitor.com/support/terminology-syntax/scripting-support/access-a-website-from-groovy

I'm wondering if I'm getting the error because I'm not inserting a payload in my method. But I don't have a payload... I'm just trying to update the header.

SmokinIndo
  • 19
  • 1
  • Should we guess the error message? – daggett Oct 12 '20 at 00:40
  • The docs you have linked state the following arguments: `.post(url, payload, headers)`. have you tried sending an empty body as payload? E.g. `.post(url, "", ["x-cisco-mer...)` – cfrick Oct 12 '20 at 05:50

0 Answers0