stretchr / goweb

A lightweight RESTful web framework for Go
632 stars 61 forks source link

always200 & method overriding for API responder? #45

Closed oleksandr closed 11 years ago

oleksandr commented 11 years ago

This one comes from your front-end developers complaining (as usually) about support of all HTTP by some browsers. Does it makes sense to add these features to the API responder?

matryer commented 11 years ago

Front end developers are my favourite - one of the reasons we built Goweb was to make your lives easier.

Always200 and the method override are actually implemented in the WebContext object.

How would they work in the API Responder?

On 14 Aug 2013, at 09:32, Oleksandr Lobunets notifications@github.com wrote:

This one comes from your front-end developers complaining (as usually) about support of all HTTP by some browsers. Does it makes sense to add these features to the API responder?

— Reply to this email directly or view it on GitHub.

oleksandr commented 11 years ago

Sorry for the confusing message yesterday - that was EOD :-) Well, the front end devs asked about emulation of the HTTP methods, in other words they want to send POST /uri?method=PUT&... instead of PUT /uri?... POST /uri?method=DELETE&... instead of DELETE /uri?... I was looking into the goweb's docs and source code and couldn't find this implemented. But I remember that v1.0 (that we started from) had this feature.

Am I blind or was it dropped in v2.0?

Thanks!

On Aug 14, 2013, at 5:43 PM, Mat Ryer notifications@github.com wrote:

Front end developers are my favourite - one of the reasons we built Goweb was to make your lives easier.

Always200 and the method override are actually implemented in the WebContext object.

How would they work in the API Responder?

On 14 Aug 2013, at 09:32, Oleksandr Lobunets notifications@github.com wrote:

This one comes from your front-end developers complaining (as usually) about support of all HTTP by some browsers. Does it makes sense to add these features to the API responder?

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

matryer commented 11 years ago

It's there -

Do we need to update the docs?

Sent from my iPhone

On 15 Aug 2013, at 06:35, Oleksandr Lobunets notifications@github.com wrote:

Sorry for the confusing message yesterday - that was EOD :-) Well, the front end devs asked about emulation of the HTTP methods, in other words they want to send POST /uri?method=PUT&... instead of PUT /uri?... POST /uri?method=DELETE&... instead of DELETE /uri?... I was looking into the goweb's docs and source code and couldn't find this implemented. But I remember that v1.0 (that we started from) had this feature.

Am I blind or was it dropped in v2.0?

Thanks!

On Aug 14, 2013, at 5:43 PM, Mat Ryer notifications@github.com wrote:

Front end developers are my favourite - one of the reasons we built Goweb was to make your lives easier.

Always200 and the method override are actually implemented in the WebContext object.

How would they work in the API Responder?

On 14 Aug 2013, at 09:32, Oleksandr Lobunets notifications@github.com wrote:

This one comes from your front-end developers complaining (as usually) about support of all HTTP by some browsers. Does it makes sense to add these features to the API responder?

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

tylerstillwater commented 11 years ago

Please see the WithStatus method in http://godoc.org/github.com/stretchr/goweb/responders for the always200 info. Please see the MethodString method in http://godoc.org/github.com/stretchr/goweb/webcontext for the method override info. Please see "Working with JSONP" in http://godoc.org/github.com/stretchr/goweb for usage.