RayRoestenburg/akka-in-action

First distributed app - http PUT localhost:5000/events event=RHCP nrOfTickets:=10

Closed this issue · 2 comments

Great book Ray et al, best scala book so far. Using the

Could not get this command to work on windows 10 (I'm running the FrontendMain on one console, the BackendMain in another console via sbt). I have another terminal to send httpie commands.

C:\Users\andy>http PUT localhost:5000/events event=RHCP nrOfTickets:=10
HTTP/1.1 405 Method Not Allowed
Allow: GET
Content-Length: 47
Content-Type: text/plain; charset=UTF-8
Date: Thu, 18 May 2017 11:03:34 GMT
Server: GoTicks.com REST API

HTTP method not allowed, supported methods: GET

this works though

C:\Users\andy>http POST localhost:5000/events/CARS tickets:=100

HTTP/1.1 201 Created
Content-Length: 29
Content-Type: application/json
Date: Thu, 18 May 2017 10:58:43 GMT
Server: GoTicks.com REST API

{
"name": "CARS",
"tickets": 100
}

C:\Users\andy>http GET localhost:5000/events
HTTP/1.1 200 OK
Content-Length: 71
Content-Type: application/json
Date: Thu, 18 May 2017 11:25:20 GMT
Server: GoTicks.com REST API

{
"events": [
{
"name": "CARS",
"tickets": 100
},
{
"name": "RHCP",
"tickets": 10
}
]
}

in summary POST works but not PUT
page number 134

Thanks, I'll have to update the errata or add PUT to the route.