Este es mi script de solicitud previa en Postman:
var requestToRun; switch (data["Condition"]) { case (1): requestToRun = [{ "test": "yusuf-klmn", "imageUrl": "", "name":"lop-kjm", "test2": "yusufplm", "type": "Product", "category": "string", "price": 0, "salePrice": 0, "currency": "TRY", "taxRatio": 0, "salesUrl": "" }] break; case (2): requestToRun = [{ "test": "yusuf-klmn", "imageUrl": "", "name":"lop-kjm" , "test2": "yusufplm", "type": "Product", "category": "string", "price": 0, "salePrice": 0, "currency": "TRY", "taxRatio": 0, "salesUrl": "" }] break; } pm.globals.set('req_body', JSON.stringify(requestToRun)); postman.setNextRequest(requestToRun); console.log(requestToRun)Este es mi contenido del cuerpo de la solicitud: (llamando a req_body aquí como un contenido del cuerpo de Json)
{{req_body}}