You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like web.go automatically processes the body of all POSTs as a form, which unfortunately leaves the body empty. For PUT (and other, I assume) requests it leaves the body intact, so it is possible to receive JSON that way. However it would be really helpful to be able to parse POST data as JSON (i.e. for building RESTful apps). Is there a way to have web.go leave the body intact after parsing the params?
Thanks!
The text was updated successfully, but these errors were encountered:
Not sure when this was added or if you're still watching, but if Content-Type is 'application/json', it copies the body data into Request.ParamData []byte. If you want an io.Reader, of course, you can use bytes.NewBuffer(request.ParamData).
It seems like web.go automatically processes the body of all POSTs as a form, which unfortunately leaves the body empty. For PUT (and other, I assume) requests it leaves the body intact, so it is possible to receive JSON that way. However it would be really helpful to be able to parse POST data as JSON (i.e. for building RESTful apps). Is there a way to have web.go leave the body intact after parsing the params?
Thanks!
The text was updated successfully, but these errors were encountered: