问题
I tried this one but didnt work for me.
I got NULL value of "date_creation" in DB (Mysql)
I used Pre-request script tab to save the date into a variable:
var current_timestamp = new Date();
postman.setEnvironmentVariable("current_timestamp", current_timestamp.toISOString());
{
"rib": "123456789",
"code_client": "3",
"taux":"19",
"decouvert" : "150",
"solde" : "8500",
"date_creation" : "{{current_timestamp}}"
}
回答1:
You have to select Raw and type JSON for request body
You can check what was send to database by opening console view>show postman console
and then click the request>request body in the console
WHich shows what was actually send to server.
If its still failing then its not issue with postman but your application
来源:https://stackoverflow.com/questions/64893960/how-to-put-datetime-in-body-postman