Loïc Hoguin
2b2829f585
Greatly expand on the Req object
...
Cut in four different chapters: request, request body,
response and cookies.
2013-09-23 15:44:10 +02:00
Loïc Hoguin
eb4843a46b
Remove unnecessary titles
2013-09-18 20:30:11 +02:00
Loïc Hoguin
7906f30d83
Greatly improve the HTTP handlers chapter
2013-09-18 20:29:48 +02:00
Loïc Hoguin
7319526de6
Added a chapter about life of HTTP requests
...
Reworked the table of contents also.
2013-09-18 12:02:37 +02:00
Loïc Hoguin
40b87545f6
Fix SPDY push explanations
2013-09-10 12:08:18 +02:00
Loïc Hoguin
c7f7e4456e
Much improved Getting started chapter
...
We now describe how to build a hello world application from
start to finish, including setting up erlang.mk for building,
and using relx for generating the release. All concepts are
not explained in details of course, but we don't need to at
this point, we just want things to be working.
2013-09-07 12:54:55 +02:00
Loïc Hoguin
4a30198f90
Make cowlib a proper dependency
...
Start moving a few functions from Cowboy into cowlib.
2013-09-04 19:24:54 +02:00
Loïc Hoguin
7855f80e4b
Fix some explanations around response bodies
2013-08-27 18:32:53 +02:00
Matthias Endler
f664329b0b
Minor corrections of the guide
2013-06-27 22:34:56 +02:00
Loïc Hoguin
61ca86b054
Greatly improve the guide introduction
2013-06-27 00:02:12 +02:00
Loïc Hoguin
b059a1237f
Reword the clean erlang code part
...
We don't care about parameterized modules anymore. They're gone!
2013-06-23 00:34:05 +02:00
Loïc Hoguin
28186a68d0
Make the HTTP version type more practical
...
Now instead of {1, 1} we have 'HTTP/1.1', and instead of {1, 0}
we have 'HTTP/1.0'. This is more efficient, easier to read in
crash logs, and clearer in the code.
2013-05-16 12:56:01 +02:00
Loïc Hoguin
e0b5526f1e
Remove cowboy_req:fragment/1
...
Clients do not send it. We skip the value if we receive it now,
as it shouldn't happen, and won't for all the mainstream clients.
2013-05-15 15:17:33 +02:00
Loïc Hoguin
9a7d606709
Fix a small error in the REST part of the guide
2013-04-26 17:08:58 +02:00
Loïc Hoguin
5291c3eb0a
Update the REST chapter of the guide
2013-04-26 14:12:29 +02:00
Loïc Hoguin
a2f4703e5e
Improve static file handler guide chapter
...
Add more infos about MIME types and the file option.
2013-04-25 18:43:48 +02:00
Loïc Hoguin
beaae7bf70
Document meta values set by REST
...
You can use these values to perform a reply using the negotiated
content-type and language for non-HEAD/GET methods.
2013-04-25 17:46:40 +02:00
Loïc Hoguin
109a1b8227
Add section about REST methods
2013-04-19 13:54:43 +02:00
Loïc Hoguin
b58a0549e1
Add default operations for OPTIONS method in REST
...
It defaults to setting the Allow header to "HEAD, GET, OPTIONS".
2013-04-12 19:02:00 +02:00
Loïc Hoguin
0460406969
Merge branch 'eventsource-helper' of git://github.com/jdavisp3/cowboy
2013-04-11 23:58:08 +02:00
Loïc Hoguin
5b9404fd07
Fix static handler snippet in the guide
...
Thanks to Martin Törnwall for pointing this out.
2013-04-11 23:26:16 +02:00
Loïc Hoguin
23aa1314fc
First draft of the REST chapter in the guide
2013-04-11 22:25:36 +02:00
Loïc Hoguin
6256429dc9
Remove cowboy_req:peer_addr/1
...
This kind of function is highly dependent on the proxy used,
therefore parsing was added for x-forwarded-for instead and we
just let users write the function that works for them. The code
can be easily extracted if anyone was using the function.
2013-04-11 22:25:36 +02:00
Dave Peticolas
e3a2fd2a5b
Add a reference to an eventsource helper utility.
2013-04-06 20:05:21 -07:00
Loïc Hoguin
2b56bb498f
Update Ranch to 0.8.0
2013-04-03 13:47:12 +02:00
Loïc Hoguin
ce1d8862c0
Replace init_stream/5 with stream_body/2
...
This allows us to change the max chunk length on a per chunk basis
instead of for the whole stream. It's also much easier to use this
way even if we don't want to change the chunk size.
2013-04-02 19:40:38 +02:00
Loïc Hoguin
66f7c15c4d
Add a guide section for resource links
2013-03-22 19:59:35 +01:00
rambocoder
84d7671e91
Check the length before reading the body in body/1 and body_qs/1
2013-03-06 08:50:45 -05:00
Loïc Hoguin
233cf43ab9
Make streamed chunk size configurable
...
Defaults to a maximum of 1000000 bytes.
Also standardize the te_identity and te_chunked decoding functions.
Now they both try to read as much as possible (up to the limit),
making body reading much faster when not using chunked encoding.
2013-03-05 21:54:35 +01:00
Loïc Hoguin
a165a0bf46
Describe arguments of the HTTP handler callbacks
2013-03-02 20:33:22 +01:00
Loïc Hoguin
8c54c048f2
Explain what are listeners and acceptors in Getting Started
2013-03-02 20:21:02 +01:00
Loïc Hoguin
8dd6ce8357
Add a recommendation about static files in production to the guide
2013-03-02 03:06:45 +01:00
Adam Cammack
88414e36b4
Add an example of onresponse hooks
...
Also fix the guide entry on hooks.
2013-03-01 19:54:30 -06:00
Loïc Hoguin
b448939282
Fix an error in the guide introduction
...
Reported by Joe Armstrong.
2013-03-01 14:03:21 +01:00
Loïc Hoguin
b29ea644fb
Add a Supported platforms section to the guide introduction
2013-02-27 18:32:46 +01:00
Loïc Hoguin
b2ffff9bec
Add cowboy:set_env/3
2013-02-20 12:14:21 +01:00
James Fish
6d67ad809c
Add sub protocol behaviour
2013-02-16 16:19:53 +00:00
Loïc Hoguin
bce7b860ee
Merge branch 'static_doc' of git://github.com/acammack/cowboy
2013-02-12 14:06:54 +01:00
Adam Cammack
6575ceb0dd
Fix examples in cowboy_static edoc and guide
2013-02-11 09:44:25 -06:00
Loïc Hoguin
c1bf0a2792
Add a few directions in the REST chapter in the guide
...
This is obviously not proper documentation. We will properly document
it when the API stabilizes.
2013-02-11 09:26:13 +01:00
Ivan Lisenkov
60291c6878
Small routing guide fix
...
Make cowboy_router:compile/1 return to be consistent with current
implementation.
2013-01-31 00:41:14 +04:00
Loïc Hoguin
a3c0ff9ccf
Fix small error in the websocket chapter in the guide
...
Reported by Michel Rijnders.
2013-01-30 19:00:47 +01:00
Loïc Hoguin
b2ba4d28f8
Add a section about closing the connection in the guide
2013-01-29 13:33:47 +01:00
Loïc Hoguin
c2c333de8a
Add the 'function' constraint
2013-01-28 23:39:21 +01:00
Loïc Hoguin
a5a69353f1
Add the 'int' constraint
2013-01-28 19:56:42 +01:00
Loïc Hoguin
a357c49d1b
New routing
...
Ultimately few things change, it's mostly just a nicer syntax and
slightly different expectations. The name of the value `dispatch`
did not change, because the previous dispatch values will now fail
if the code is not updated to using `cowboy_router:compile/1`.
No constraints have been implemented in this commit.
2013-01-28 16:53:09 +01:00
Loïc Hoguin
647e95aed1
Replace terminate/2 with terminate/3, adding a Reason
...
This should have been done a *long* time ago, back when I initially
added Websocket support. This is the first part of two in improving
loop handler support with regards to socket closure.
Reason may include: {normal, shutdown} for the most normal shutdown,
{normal, timeout} for a loop handler timeout shutdown, or {error, _}
if an error occured.
2013-01-22 02:34:18 +01:00
Loïc Hoguin
fe462599c2
Merge pull request #369 from rramsden/patch-1
...
Fix typo in the guide introduction
2013-01-21 09:03:14 -08:00
Loïc Hoguin
4b15d8f6e3
First draft done for the request object guide chapter
2013-01-20 15:14:13 +01:00
Loïc Hoguin
42e3468fec
More request object documentation in the guide
2013-01-19 17:58:58 +01:00