0

I have JSON:

{
   title: "Some title",
   author: "Name",
   text: "This is text..."
}

that I want to store to my Riak via curl.I'm using command:

curl -v -X PUT http://192.168.56.12:10018/riak/news/news1 -H "Content-Type: application/json" -d "{"title":"Some title","author":"Name","text":"This is text..."}"

And when I try to see what's in the bucket called news with key news1 via Firefox I get only: {title:Some

What is not correct here?

DynamicsNinja
  • 177
  • 1
  • 3
  • 17

1 Answers1

1

Your argument to -d should be in single quotes:

-d '{"title":"Some.....}'

Luke Bakken
  • 8,993
  • 2
  • 20
  • 33
  • thx, now i get '{title:Some title,author:Name,text:This is text...}'. JSON values are not in "" so will they be decoded as strings? – DynamicsNinja Jan 03 '15 at 15:17
  • 1
    Luke's example is missing a closing double quote on the value, maybe you replicated this? Otherwise depending on how you're using the returned JSON you may need to backslash escape the double quotes before storing, `'{title: \"Some title\", ... }'` – ianmjones Jan 03 '15 at 22:31