xeqi / peridot

a basic api for interacting with ring apps
144 stars 20 forks source link

Show the body of urlencoded requests #13

Open kenrestivo opened 10 years ago

kenrestivo commented 10 years ago

When debugging why a ring-anti-forgery test is failing, it's kind of hard without seeing the form urlencoded params that are being sent. I know what I think I'm sending, but the error I'm getting back indicates that what is being received is not correct.

i.e., with a form request, the result comes back as:

{:request 
    { :content-type "application/x-www-form-urlencoded",
      :body #<BufferedInputStream java.io.BufferedInputStream@24cd65cc>}, }}

It'd be helpful to see what exactly that :body was. However, trying to slurp the body doesn't work because the stream has long since been closed by the time request returns.

elrob commented 9 years ago

Plus one. Having exactly the same issue with ring-anti-forgery test failing. It seems as though peridot is converting urlencoded '+' to a space.

glenjamin commented 8 years ago

Just looking over this just now, is there a rewindable input stream we could use instead?