您的命令行应该在要发送到PUT中的字符串之前插入-d
/-数据,并且您要设置Content-Type而不是Accept。
curl -H 'Content-Type: application/json' -X PUT -d '[JSON]' http://example.com/service
使用问题中的确切JSON数据,完整的命令行将变为:
curl -H 'Content-Type: application/json' -X PUT -d '{"tags":["tag1","tag2"],"question":"Which band?","answers":[{"id":"a0","answer":"Answer1"},{"id":"a1","answer":"answer2"}]}' http://example.com/service


