sahilrajput03

Learn postman

image

image

image

image

image

image

image

image

Source Stackoverflow Answer: Click here

// Strip JSON Comments
if (pm?.request?.body?.options?.raw?.language === 'json') {
    const rawData = pm.request.body.toString();
    const strippedData = rawData.replace(
        /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g,
        (m, g) => g ? "" : m
    );
    pm.request.body.update(JSON.stringify(JSON.parse(strippedData)));
}

// To set Content-Type again (see the original stackoverflow answer's comment section):
// pm.request.upsertHeader({key: 'Content-Type', value: 'application/json'});

image

image

image

image

Click here

image