How do I programmatically get the content length of a Postman request INCLUDING variable values?
I need to include the content-length header in a PUT request I'm putting together in Postman. I can get the request content length in a pre-request script, however, according to the Postman script documentation, the pre-request script is (duh) getting the content length prior to the request being generated (or only sent?). This is problematic for my scenario, because I need the content length AFTER the variable values are filled in for the request.
//Get request length
var rdata = request.data;
var requestLength = JSON.stringify(JSON.parse(rdata)).length;
pm.environment.set("requestLength", requestLength);
console.log(requestLength);