From 529de4d51887669349e49ef8f25f79ba5e93fd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 18 Jan 2013 18:04:21 +0100 Subject: Beginning of request object chapter in the guide --- guide/req.md | 19 ++++++++++++++++--- guide/toc.md | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'guide') 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. diff --git a/guide/toc.md b/guide/toc.md index 870ce62..b6675e6 100644 --- a/guide/toc.md +++ b/guide/toc.md @@ -38,7 +38,7 @@ Cowboy User Guide * Purpose * Request * Request body - * Reply + * Response * [Hooks](hooks.md) * On request * On response -- cgit v1.2.3