Good morning, would anyone know how to solve this problem?
JSONError: Unexpected token 'E' at 1:1 EVENT_ RECEIVED ^
Thank you so much
Good morning, would anyone know how to solve this problem?
JSONError: Unexpected token 'E' at 1:1 EVENT_ RECEIVED ^
Thank you so much
Can you edit your title and question to explain the issue that youβre facing please. What you have now lacks context and information.
Please use this as a guide:
As, @danny-dainton mentioned, more context is needed to understand the issue and your use-case
But given the error posted in the title, if I have to hazard a guess, you have code in the βTestβ tab that is trying to parse the API response as JSON, but the API did not return a valid JSON response. Thus, the failure to parse and the error.
This is nearly always because you have code in your tests tab (or pre-request script) that is trying to parse JSON data but is failing because the element you are trying to parse is not JSON.
JSON starts with either a { (to denote an object) or [ (to denote an array).
What the error is telling you is that the first character is an βEβ so its an unexpected character\token. Have a look at the response, and I suspect it starts with βErrorβ or similar.
This can happen if you are not getting 200 success status codes. A 401 authentication error does not return a JSON response, so if you try and parse that it will fail with the error in the title.
So you are looking at any pm.response.json() or JSON.parse elements in your code.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.