Last active
November 20, 2022 06:28
-
-
Save jmhungdev/57d463e823f9251c347f294f357b5827 to your computer and use it in GitHub Desktop.
Postman Scripting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load html reponse in cheerio and retrieve the text of first h2 tag | |
const $ = cheerio.load(pm.response.text()); | |
let latestDate = $("h2").first().text() | |
const requrl = `https://postman-echo.com/get?date=${latestDate}` | |
// send async request with callback | |
pm.sendRequest(requrl, function (err, response) { | |
console.log(response.json()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment