dbrain / soggy

An fast and simple express/sinatra like web framework.. thing.. for Go.
45 stars 1 forks source link

Body parsing #3

Closed dbrain closed 11 years ago

dbrain commented 12 years ago

As one of the cool hip kids using soggy, I'd like incoming request bodies to be parsed so I can avoid boilerplate code converting incoming JSON requests etc. This may just be a matter of parsing depending on the Content-Type. Although it'd be nice if it could Unmarshal into a struct as well as a map[string]interface{}. Play with a few options and see what works.

dbrain commented 12 years ago

Maybe don't parse until the route actually asks for information from the user, no point parsing if the route ignores the inputs.

dbrain commented 11 years ago

Added some basic body parsing (req.GetBody()), this only supports JSON currently. It will cache the first result so multiple calls wont reparse the body.