Adding body in elastic heartbeat configuration

Hello
Kindly we need to add api to elastic heartbeat configuration and we need to pass post body json object in the configuration so how can we do that

http://url-api
{
"GetFees": {
"CRNumber": "5555555",
"TransactionFromDate": "2018-01-01",
"TransactionToDate": "2021-10-13",
"PageIndex": 1,
"PageSize": 1000
}
}

so make the configuration like below but it fail so any help

- type: http
  name: GEstablishmentTransaction
  enabled: true
  schedule: "@every 5m"
  timeout: 60s
  urls: ["http://url-api"]
  check.response.status: [200,400,401,403,409,404]
  check.request:
    method: POST
    headers:
      'Content-Type': 'application/json'
    body:
      GetFees:
         CRNumber: "555555"
         TransactionFromDate: "2018-01-01"
         TransactionToDate: "2021-10-13"
         PageIndex: 1
         PageSize: 1000

Hi @amr_ibrahim,

have you tried supplying the body as a JSON-encoded string (i.e. body: '{"GetFees": {...}}')?

Hi @weltenwort,
Thank you I try your recommendation and working fine
Thank you

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