These are chat archives for gin-gonic/gin
Gin is a web framework written in Golang. It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
// 307 = http.StatusTemporaryRedirect c.Redirect(307, "/view/"+post.ID)
there are different redirect codes, you need 307
The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.
@pavlik dude! I am reading the HTTP standard, and you may have to use 303: 10.3.4 303 See Other
The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource. The 303 response MUST NOT be cached, but the response to the second (redirected) request might be cacheable.
[GIN-debug] GET /new --> main.articleNew (3 handlers) [GIN-debug] GET /edit/:id --> main.articleEdit (3 handlers) [GIN-debug] GET /delete/:id --> main.articleDelete (3 handlers) [GIN-debug] GET /view/:id --> main.articleGet (3 handlers) [GIN-debug] GET / --> main.articlesGetAll (3 handlers) [GIN-debug] POST / --> main.articleSave (3 handlers) [GIN-debug] Listening and serving HTTP on :8080 [GIN] 2015/05/24 - 21:55:52 | 200 | 4.084299ms | [::1]:55949 | GET / [GIN] 2015/05/24 - 21:55:54 | 200 | 413.777µs | [::1]:55949 | GET /new 0 New post ID: 16 [GIN] 2015/05/24 - 21:55:58 | 302 | 2.321645ms | [::1]:55949 | POST / [GIN] 2015/05/24 - 21:55:58 | 200 | 1.19972ms | [::1]:55949 | GET /view/16