I have a code like the following which works:
const url = "https://something"; let data2 = JSON.stringify({ source: \'https://someimage.jpg\