Insomnia: Invalid JSON: Unexpected token ) in JSON at position 0

1.9k views Asked by At

This is response of the Login request that i need to extract data from. As you can see first line is not JSON format and Insomnia is complaining about it as "Invalid JSON: Unexpected token ) in JSON at position 0"

Is there any way to ignore/remove first line then extract data? May be custom query?

)]}',
{
    "userid": "USER1",    
    "email": "[email protected]",    
    "name": "John Jones"
}

enter image description here

enter image description here

1

There are 1 answers

2
Michael Kay On

If this is a one-off, just delete the first line with a text editor.

If it's happening systematically, then (a) you really ought to get it fixed at source rather than repairing it after the event, and (b) you need to know what the general pattern of bad data is, rather than working from one example.