I am trying to create Web API following this book http://www.apress.com/9781484201107?gtmf=c. I got to the end of chapter 5 and when I run my solution I got this error message:
Cannot open database "WebApi2BookDb" requested by the login. The login failed.
Login failed for user 'Domain\myusername'.
I thought that maybe I have messed up somwhere but when I downloaded source (available here Chapter 5: http://www.apress.com/downloadable/download/sample/sample_id/1577/) I got the same exact message.
The connection string is: <add name="WebApi2BookDb" providerName="System.Data.SqlClient" connectionString="Server=.;initial catalog=WebApi2BookDb;Integrated Security=True;Application Name=WebApi2Book API Website" />
I am using Visual Studio 2013. What could be solution for this problem?
Supposedly sending this request:
POST ht tp://localhost:61589/api/v1/tasks HTTP/1.1
Content-Type: text/json
{"Subject":"Fix something important"}
You should get response that should look something like this:
HTTP/1.1 201 Created
Content-Type: text/json; charset=utf-8
Loation: ht tp://localhost:61589/api/v1/tasks/10
{"TaskId":10,"Subject":"Fix something important","StartDate":null,"DueDate":null,
"CreatedDate":"2014-05-04T02:52:39.9872623Z","CompletedDate":null,
"Status":{"StatusId":1,"Name":"Not Started","Ordinal":0},"Assignees":[],
"Links":[{"Rel":"self","Href":"ht tp://localhost:61589/api/v1/tasks","Method":"GET"}]}