Monitor API in heartbeat

I'm trying to monitor an API that is behind Azure API management using heartbeat, and I need to submit the API key.

This works: "curl" -H "Ocp-Apim-Subscription-Key: 1234567890" -i -s"

My heartbeat config is:
method: "GET"
"'Ocp-Apim-Subscription-Key': '1234567890'"


but all i get is ""statusCode": 401, "message": "Access denied due to missing subscription key"
What am I missing?

If you look at the headers section: you will notice that it isnt wrapped in double quotes.

I think you would just want to put 'Ocp-Apim-Subscription-Key': '12345' on the line after the other header.

It looks like:

- type: http
  schedule: '@every 5s'
  urls: ["http://localhost:8080/demo/add"]
    method: POST
      'Content-Type': 'application/x-www-form-urlencoded'
      'Ocp-Apim-Subscription-Key': '12345' # Maybe?
    # urlencode the body:
    body: "name=first&"
    status: 200
      - Saved
      - saved

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.