stretchr / goweb

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

Why aren't dotted values allowed for resource ids? #86

Open qur opened 10 years ago

qur commented 10 years ago

goweb seems to always assume that a . means a file extension - but when using a controller this doesn't really make sense.

e.g. DELETE /something/10.0.0.1 would call somethingController.Delete("10", ctx) - which seems really very wrong ...

tylerstillwater commented 10 years ago

goweb allows you to override the codec being used by passing a different extension (.xml,.json).

Obviously this is a problem for you. Do you have any thoughts on a way to handle this differently?

qur commented 10 years ago

How about adding a flag to HttpHandler that can cause WebContext to use a new Path constructor that doesn't split out the extension instead of NewPath? Whilst it might be nice to be able to select on a per Controller basis, I can't see a practical way to accomplish that, and don't myself need to.