且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

curl json 通过终端向 rails 应用程序发送请求

更新时间:2022-11-27 11:27:02

首先,您的命令末尾有一个无关紧要的.

First off, there is an extraneous " at the end of your command.

试试这个

curl -v 
  -H "Accept: application/json" 
  -H "Content-type: application/json" 
  -X POST 
  -d ' {"user":{"first_name":"firstname","last_name":"lastname","email":"email@email.com","password":"app123","password_confirmation":"app123"}}' 
  http://localhost:3000/api/1/users