mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 13:10:24 +00:00
Beginning of request object chapter in the guide
This commit is contained in:
parent
1476b13ca0
commit
529de4d518
2 changed files with 17 additions and 4 deletions
19
guide/req.md
19
guide/req.md
|
@ -4,7 +4,20 @@ Request object
|
||||||
Purpose
|
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
|
Request
|
||||||
-------
|
-------
|
||||||
|
@ -16,7 +29,7 @@ Request body
|
||||||
|
|
||||||
@todo Describe.
|
@todo Describe.
|
||||||
|
|
||||||
Reply
|
Response
|
||||||
-----
|
--------
|
||||||
|
|
||||||
@todo Describe.
|
@todo Describe.
|
||||||
|
|
|
@ -38,7 +38,7 @@ Cowboy User Guide
|
||||||
* Purpose
|
* Purpose
|
||||||
* Request
|
* Request
|
||||||
* Request body
|
* Request body
|
||||||
* Reply
|
* Response
|
||||||
* [Hooks](hooks.md)
|
* [Hooks](hooks.md)
|
||||||
* On request
|
* On request
|
||||||
* On response
|
* On response
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue