Lēctia Landau
Lēctia Landau

Reputation: 573

Why does cURL output "Request didn't contain valid JSON?"

I looked everywhere for an answer, but couldn't find it.

I'm trying to run the following cURL command to the Kippt API: curl -k --user xxxxxxx:xxxxxxx -X POST -H 'Content-Type: application/json' --data "{"title":"Meteor.js","is_private":false}" https://kippt.com/api/lists.

This returns: "message": "Request didn't contain valid JSON.". Maybe it's something wrong with the command itself, maybe with the interaction with the Kippt API, but whatever it is, I can't seem to run this command.

Why does this happen, and how can I get around it?

P. S. It should be noted that I need this for a rather awkward Ruby-based resources-file parser thingie, and I can't use a file to hold the JSON. It has to be used raw in the cURL command itself.

Upvotes: 0

Views: 690

Answers (1)

dancow
dancow

Reputation: 3388

Don't you need to escape your quotation marks?

curl -k --user xxxxxxx:xxxxxxx -X POST -H 'Content-Type: application/json' --data "{\"title\":\"Meteor.js\",\"is_private\":false}" https://kippt.com/api/lists

Upvotes: 1

Related Questions