Ask Your Question
1

HTTP client: Dynamic parameter in request body.

asked 2018-06-18 00:06:29 -0500

Kumar gravatar image

I am polling a rest service with http client , there I need to pass a parameter date in request body, which has to be current date in a specific format.

How can I achieve this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-18 10:29:30 -0500

metadaddy gravatar image

Set the HTTP Method to POST and you can configure a Request Body. This example is in JSON, but you can pretty much do whatever you want. Change the timezone/date format to suit your use case.

{
  "timestamp" : "${time:extractStringFromDateTZ(time:now(), 'UTC', 'yyyy-MM-dd\'T\'HH:mm:ss.SSSZ')}"
}
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-18 00:06:29 -0500

Seen: 33 times

Last updated: Jun 18