Posted 30 August 2024, 1:29 am EST
Hi Anju,
You may specify the body for a POST request in the Post body section of the DataSet designer.
Please note that ActiveReportsJS uses ‘{’ & ‘}’ to define its custom expressions. When using JSON, one ‘{’ is treated as an escape character in ‘{{’ to treat your JSON as a string instead of an ARJS expression. Hence, you may add the following expression in the Post Body:
{{
"ClientCode": "35",
"UserId": "",
"TransactionType": 2,
"SearchString": "",
"FundRiskRating": 1,
"LastBusinessDate": "2021-04-15T09:47:31.294Z",
"FundHouseName": "kotak"
}
For more details, please refer to the attached documentation links:
Please run the attached sample using the following steps demonstrating the above:
- Run the sample using the following commands:
npm i
npm start
- Open the Developer Console by clicking
F12
, and go to the Network tab.
- Now preview the report, select the value for the 'fundHouseName_ parameter, and click on Preview.
- In the Network tab, you will notice a failed call to ‘Customers’ as the DataSource does not support the specified parameters. However, by clicking on the same, we can verify the values of the passed parameters.
- Click on ‘Customers’ and go to the Payload tab; there you’ll find that your selected parameter has been passed into the query as expected!
We hope this helps!
Attachment:HTTP_POST_Sample.zip