GroveStreams

Error A JSONObject text must begin with '{' at character 1531

pat private msg quote post Address this user
HI,

I am doing a simple PUT with a curl command of a uncompressed json file

The command is
curl -d "filepush" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cookie: api_key=xxxxx-611a-xxxx-8a2a-xxxxx" -X PUT http://www.server.com/api/feed


The content of the file is
{"feed": {
    "component": [{
        "componentId": "Id0099",
        "stream": [
            {
                "data": [198],
                "streamId": "rx"
            },
            {
                "data": [70],
                "streamId": "tx"
            }
        ]
    }],
    "time": [1548795712000]
}}



I have this error
{"success":false,"errCode":"UNKNOWN_EXCEPTION","message":"A JSONObject text must begin with '{' at character 1"}


Any idea from where that could come from ?

Thank you
Post 1 IP   flag post
pat private msg quote post Address this user
I am replying to myself it is the -T command for the file
curl -T "filepush"
Post 2 IP   flag post
MikeMills private msg quote post Address this user
The JSON format looks correct. The error seems to indicate that what is being passed to our JSON decoder doesn't start with a "{".

My guess is either nothing is being passed in or the first character is a hidden character you're not seeing in an editor such as the encoding token. You might want to use an editor that displays all hidden tokens to make sure.

Check your system notifications and see if the error includes the JSON string. If so, then we know the json is being passed up.

GS API tracing might help (in your oreg, menu api keys, select the key, then engage tracing, then watch system notifications). If API tracing tries to parse the JSON, then that might fail too.
Post 3 IP   flag post
3006 3 3
Log in or sign up to compose a reply.