Go HTTP Post and use Cookies
Go 1.1 introduced a cookie jar implementation net/http/cookiejar. import ( “net/http” “net/http/cookiejar” ) jar, err := cookiejar.New(nil) if err != nil { // error handling } client := &http.Client{ Jar: jar, }
Go 1.1 introduced a cookie jar implementation net/http/cookiejar. import ( “net/http” “net/http/cookiejar” ) jar, err := cookiejar.New(nil) if err != nil { // error handling } client := &http.Client{ Jar: jar, }
Use POST for destructive actions such as creation (I’m aware of the irony), editing, and deletion, because you can’t hit a POST action in the address bar of your browser. Use GET when it’s safe to allow a person to call an action. So a URL like: http://myblog.org/admin/posts/delete/357 Should bring you to a confirmation page, … Read more