How to pass current date as Value in Get and Post Request | Postman API Tutorial

preview_player
Показать описание
Welcome to The TechFlow, your go-to destination for concise and insightful technical videos.

We are here to share with you simplified knowledge which we have earned and learned through our years of work experience with technology.

How to pass current date as Value in Get and Post Request | Postman API Tutorial
In this video I will teach how to pass current date time stamp in GET and POST type of request parameter.
We will also learn how to pass past or future time in request.

Format Date and Time:

TABLE OF CONTENTS
Introduction 00:00
How to pass current time in GET parameter from Postman 00:08
How to pass current time in POST parameter from Postman 01:55
How to format date and time variable in Postman 03:20
Which formats are available for moments library in Postman 03:36
How to set past and future time in postman variable 03:59
Thank You

Complete Postman API Testing Tutorial Playlist:

#postman #postmantutorial #postmandatetime
Рекомендации по теме
Комментарии
Автор

I appreciate your explanation!! thanks bro

nicolasmarioni
Автор

Thanks for your video
can you help me how to build the api to get whether report of last 2 days

annapureddy.
Автор

hello bro thanks for the video, but i have a doubt, I made a mock server such that when it receives a date time API the server need to dynamically send the API date time response.
here i have updated the request body with :


}

pre-request script:
const moment = require('moment');
const currentDateTime =
pm.variables.set('currentDateTime', currentDateTime);


reponse body:
{
"status": "success",
"date-time": "0000"
}

bro does this wrk, what change should be made.hope u respond:)

zcvtwhd
Автор

How do you add future date e.g +7days?

ayodejijoseph
Автор

automation thru postman explained very nicely. Appreciate your efforts for making this series of usefull videos.

I have a challange where I need to send checksum in every request. And check sum calculated on payload size. How I can send this checksum value automatically in every request.

The payload is in json format. Example payload:
(I have logic to generate checksum, but I need to calculate and replace it before sending the request. Can I automate this calculation in postman?? )


{
"type": "people",
"id": "42",
"attributes": {
"name": "John"
}
"user-limit": 4,
"checksum": 211856345
}

Here checksum calculated for the below json payload first, and then added checksum.

{
"type": "people",
"id": "42",
"attributes": {
"name": "John"
}
"user-limit": 4
}

infovideo