30 days of Postman - Day 25 POST issue

I am working on 30 days of Postman, Day 25.

Here is my body:

Here is my Pre-request Script:

Here is my result, which I think is incorrect. Shouldn’t it echo back what I sent in the body via the payload?

Maybe that is a passing result? I submitted it & it shows I passed. I guess we call it a win?

Though, you are supposed to add a test to check one of the response properties. How can you do that with the response that you got?

Hey @bemo2023 , do you have a link to that public workspace? It should indeed return the color details and not just an object :thinking:

You need to stringify the object when storing it as a collection variable.

let ppayload = {
    "hex": "#7b076a",
    "rgb": "rgb(123, 7, 106)",
    "name": "Cardinal Pink"
};

pm.collectionVariables.set("payload", JSON.stringify(ppayload));
console.log(pm.collectionVariables.get("payload"));

image

Otherwise, you get…

image

1 Like

That worked! Thank you!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.