I launch an asp.netcore mvc project with a controller accepting post with json object as parameter
then I used Insomnia rest client to test this action by posting json object to the action
however I get bad request error
when I do the post via webpage, it works fine
what is wrong with my test from the rest client
* Preparing request to http://localhost:51840/Books/Create
* Using libcurl/7.51.0-DEV OpenSSL/1.0.2j zlib/1.2.8 libssh2/1.6.1_DEV
* Enable automatic URL encoding
* Enable SSL validation
* Enable cookie sending with jar of 0 cookies
* Found bundle for host localhost: 0x1df804a67a0 [can pipeline]
* Re-using existing connection! (#6) with host localhost
* Connected to localhost (::1) port 51840 (#6)
> POST /Books/Create HTTP/1.1
> Host: localhost:51840
> User-Agent: insomnia/5.14.9
> Content-Type: application/json
> Accept: */*
> Content-Length: 32
| {
| "Id" : 5,
| "Name": "Book 3"
| }
* upload completely sent off: 32 out of 32 bytes
< HTTP/1.1 400 Bad Request
< Server: Kestrel
< X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcbWljcm9cRG9jdW1lbnRzXFZpc3VhbCBTdHVkaW8gMjAxN1xQcm9qZWN0c1xRdWlya3lCb29rTGlzdFxCb29rTGlzdFxCb29rTGlzdFxCb29rc1xDcmVhdGU=?=
< X-Powered-By: ASP.NET
< Date: Fri, 16 Mar 2018 08:03:48 GMT
< Content-Length: 0
* Curl_http_done: called premature == 0
* Connection #6 to host localhost left intact