Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am trying to print the HTTP body in the tLogRow sending it through the tREST.How can I Print the REquest Body?
Hello @K11
Do you want to print the body string of http body?
If so, assign the body string to a context variable and set the http body field using context variable, then you can print the value of context variable on any other components such as tJava, tJavaRow or log the value of context variable to console through tFixedFlowInput--main--tLogRow.
Regards
Shicong
HI @Shicong_Hong ,
Thank you very much,if it is possible can you share one example. It will be a great help.
Below is the HTTP body I was passing
"{
\"disbursement_date\":\"11-02-2024\",
\"disbursement_mode\":\"ECS\",
\"branch_code\":\"0001\",
\"center_code\":\"332\",
\"officer_code\":\"V45801\",
\"disbursements[0][account_no]\":\"12345667\",
\"disbursements[0][amount]\":\"12345\",
\"disbursements[0][bank_account_no]\":\"11222222222\",
\"disbursements[0][bank_wire_code]\":\"ABC1234567\",
\"disbursements[0][remark]\":\"\",
\"disbursements[0][foreclosure_reason]\":\"\"
}"
Regards
K11
If you want to print this http body on the console, you just need to do it on a tJava component before tRest, for example:
tJava--onsubjobok--tRest
on tJava:
context.body="your http body string";
System.out.println(context.body);
On tRest comonent, set the Http body field using context variable: context.body
Regards
Shicong
Hi Shicong_Hong,
How can i show the above payload in the table format keys as column and value in rows ? and how to send form-data in the tRest
If you print the payload string using tLogRow component, you can select the 'Table' mode.
Is this payload correct for the body. I am getting below error