‹ @saulecabrera | words

Tags / plug


Ever wondered why sometimes Plug.Conn.read_body/2 returns nil instead of returning the raw body of the request? Today we’ll examine why this happens and how to elegantly get around it. Plug crash course Before exploring why this happens, let’s take a step back and take a naive look on how Plug works. In its most basic sense, a plug is a transformation applied to a connection; a plug can be either a function, or a module that receives information about a request in the form of %Plug.
« Older posts Newer posts »