I am stuck at several points:
1-I don’t know how to put randomInt in the request
const colorAPIRequest = {
// url: http://thecolorapi.com/id?rgb=rgb($[$randomInt}, $ {$ randomInt}, $ {$ randomInt})
,
url: http://thecolorapi.com/id?rgb=rgb(1, 2, 999)
,
method: ‘GET’
};
2-I don’t understand how to use the replaceIn
var body =
{
“hex”: “{{$ randomHexColor}}”,
“rgb”: “rgb ({{$ randomInt}}, {{$ randomInt}}, {{$ randomInt}})”,
“name”: “{{rgbName}}”,
}
;
body = pm.variables.replaceIn (body, rgbName);
pm.collectionVariables.set ('payload', JSON.stringify (body));
Please help