POST JSON data to simple rails application with curl

前端 未结 3 910
臣服心动
臣服心动 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:51

    take a block of JSON

    {\"a\":\"this_is_a\"}
    

    and url encode it

    %7B%22a%22%3A%22this_is_a%22
    

    and then use curl to post it

    curl -i --data "working_params=%7B%22a%22%3A%22this_is_a%22" http://url/accepts/json
    

提交回复
热议问题