Unexpected token \ in JSON at position 1 in chapter test-the-apis

I’m on windows VS code using git bash.
npx aws-api-gateway-cli-test … --body “{“content”:“helloworld”,“attachment”:“hello.jpg”}”

This is giving me -
undefined:1
{\content:\helloworld,\attachment:\hello.jpg}
^
SyntaxError: Unexpected token \ in JSON at position 1

The same thing when I tried on cmd prompt gives the same error.

By looking at other solutions on git I tried
“{“content”:“helloworld”,“attachment”:“hello.jpg”}”

‘{“content”:“helloworld”,“attachment”:“hello.jpg”}’

are still giving me similar errors.

Try removing the JSON.parse from your function.

I notice in prod, you need JSON.parse while you don’t when you’re testing. It might be the other way around but test both cases and see.