シンプルなjsonアプリがあります。のようなリクエストをするとうまくいきます
curl -X POST --data "userId=1" http://localhost:8080/register
しかし、json リクエストを作成しようとすると、リクエストが失敗します。
curl -v -H "Content-type: application/json" -X POST -d '{"userId"=1}' http://localhost:8080/register
> Content-type: application/json
>
< HTTP/1.1 415 Unsupported Media Type
< Server: spray-can/1.3.3
< Date: Mon, 07 Sep 2015 14:37:29 GMT
< Content-Type: text/plain; charset=UTF-8
<
Expected 'application/x-www-form-urlencoded' or Expected 'multipart/form-data'
スプレーにjsonリクエストを処理するように依頼する方法は?