Plug and "unfetched" connections

522 views
Skip to first unread message

easco

unread,
Apr 2, 2015, 2:01:26 PM4/2/15
to elixir-l...@googlegroups.com
In the Plug documentation for Plug.Conn (http://hexdocs.pm/plug/Plug.Conn.html) under the header of Fetchable Fields it says

Before fetching those fields return a Plug.Conn.Unfetched record.

I'm afraid that I don't understand what that means.  Does it mean that my handlers are not supposed to return a conn structure for which I have already fetched one of the fetch able fields? 

José Valim

unread,
Apr 2, 2015, 3:58:08 PM4/2/15
to elixir-l...@googlegroups.com
It means that if you access conn.params before calling fetch_params/2 or invoking Plug.Parsers, it will return a Plug.Conn.Unfetched struct. The docs are wrong though, it returns a struct, no a record.



José Valim
Skype: jv.ptec
Founder and Lead Developer

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/0fb87b22-9af0-45c2-b92e-5080eea19987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

easco

unread,
Apr 2, 2015, 5:23:31 PM4/2/15
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
OK.  I'll see if I can submit a pull request which I hope will clarify the docs.  Thank you!

easco

unread,
Apr 2, 2015, 5:43:05 PM4/2/15
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
For those playing along using our home game –

https://github.com/elixir-lang/plug/pull/216

Reply all
Reply to author
Forward
0 new messages