Request Command
VERB PATH PROTOCOL GET /foo HTTP/1.1
Request Headers
NAME: VALUE Accept: text/html
Empty Line
Request BodyResponse Status
PROTOCOL CODE NAME HTTP/1.1 200 OK
Response Headers
Content-Type: text/html
Empty Line
Response BodyMap Request verb & path to handler conf/routes
GET / controllers.Application.index
Reads the request and returns a response app/controllers/Application.java
public static Result index() { return ok("hello"); }
telnet localhost 9000 GET / HTTP/1.1
REST: Representational state transfer
POST = Create GET = Read PUT = Update DELETE = DELETE
Request:
Cookie: foo=bar
Response:
Set-Cookie: foo=blah response().setCookie("blah", "foo"); return ok("hello, " + request().cookie("foo").value());
The root of all CSRF