Newlines in JSON payload can cause failure #33

Closed
OddBloke opened this Issue Aug 1, 2014 · 1 comment

Comments

Projects
None yet
3 participants
@OddBloke
Contributor

OddBloke commented Aug 1, 2014

Putting the below JSON in post.json and submitting it via curl -H "Content-Type: application/json" -X POST https://live.stellar.org:9002 -d - < post.json gets a response containing "Unable to parse request". If I remove all of the new lines and indentation, it works.

{
    "method": "submit",
    "params": [
        {
            "secret": "<secret>",
            "tx_json": {
                "TransactionType": "TrustSet",
                "Account": "gK7NVjpKeR54Y8dEBqPTye9MW4C69cvWCK",
                "LimitAmount": {
                    "value": "20",
                    "currency": "NZD",
                    "issuer": "gs9HHU3pmkKBuvykhNm6xiK1JKrput9i3K"
                }
            }
        }
    ]
}

@marco89nish marco89nish self-assigned this Aug 1, 2014

@marco89nish

This comment has been minimized.

Show comment
Hide comment
@marco89nish

marco89nish Aug 2, 2014

Contributor

I suggest using curl -H "Content-Type: application/json" -X POST https://live.stellar.org:9002 -d @post.json to avoid issues. I'll look into possible problem with parsing.

Contributor

marco89nish commented Aug 2, 2014

I suggest using curl -H "Content-Type: application/json" -X POST https://live.stellar.org:9002 -d @post.json to avoid issues. I'll look into possible problem with parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment