Add body to a request while checking for status of the url in heartbeat

How to add body to a request while checking for status of the url in heartbeat.

Here is my sample from heartbeat.yml

  • type: http
    enabled: true
    name: "vtrack"
    urls: [""]
    check.request:
    method: GET
    headers: [
    'Content-Type': 'application/json',
    'sessionId': '',
    'userType': '']
    body: {"data":["XXXXX"],"key":"YYYYY"}
    check.response.status: 200
    schedule: '@every 60s'

Above line throws error that body should be an string and not an object. And moreover how do we add username and password to the url ?

Yes, the error is correct. You'll need to quote the JSON body as a string, perhaps using YAML multiline strings.

Thank you. It worked. But still i dont know how to attach username password for the request ?

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