How to Log the request on console

Hi Team,

Due to better debugging purposes, I need to log the request along with the payload and the relevant response. The response I can log into the console log, how can I log the original request and payload.

let res=http.post(‘http://www.examples.com’,
{
username:‘user’,
password:‘pass’
});

console.log(???)
console.log(res.body);

console.log(res.url)

Will help to capture the request URL