aboutsummaryrefslogtreecommitdiffstats
path: root/guide/req.md
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-01-18 18:04:21 +0100
committerLoïc Hoguin <[email protected]>2013-01-18 18:04:21 +0100
commit529de4d51887669349e49ef8f25f79ba5e93fd43 (patch)
treea1fa5929b9d8c8a22d82ec4293010fced8257653 /guide/req.md
parent1476b13ca0e19daf97548c0d47fe648d438985ef (diff)
downloadcowboy-529de4d51887669349e49ef8f25f79ba5e93fd43.tar.gz
cowboy-529de4d51887669349e49ef8f25f79ba5e93fd43.tar.bz2
cowboy-529de4d51887669349e49ef8f25f79ba5e93fd43.zip
Beginning of request object chapter in the guide
Diffstat (limited to 'guide/req.md')
-rw-r--r--guide/req.md19
1 files changed, 16 insertions, 3 deletions
diff --git a/guide/req.md b/guide/req.md
index 79c59a9..70873ec 100644
--- a/guide/req.md
+++ b/guide/req.md
@@ -4,7 +4,20 @@ Request object
Purpose
-------
-@todo Describe.
+The request object is a special variable that can be used
+to interact with a request, extracting information from it
+or modifying it, and sending a response.
+
+It's a special variable because it contains both immutable
+and mutable state. This means that some operations performed
+on the request object will always return the same result,
+while others will not. For example, obtaining request headers
+can be repeated safely. Obtaining the request body can only
+be done once, as it is read directly from the socket.
+
+All calls to the `cowboy_req` module will return an updated
+request object. You MUST use the new request object instead
+of the old one for all subsequent operations.
Request
-------
@@ -16,7 +29,7 @@ Request body
@todo Describe.
-Reply
------
+Response
+--------
@todo Describe.