POST JSON data to simple rails application with curl

前端 未结 3 909
臣服心动
臣服心动 2021-02-02 02:04

I set up a simple new rails application with model entry, with attributes title and content using scaffolding.

now I am trying to use curl to

3条回答
  •  孤街浪徒
    2021-02-02 02:42

    I ran a test and got the error MultiJson::DecodeError (743: unexpected token at '{'content':'I belong to AAA','title':'AAA'}'):

    JSON requires double quotes for keys and strings, not single quotes. Try --data '{"content":"I belong to AAA","title":"AAA"}'

提交回复
热议问题