poster.go 302 B

12345678910111213141516
  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. "net/url"
  6. )
  7. // https://zetcode.com/golang/getpostrequest/ post_req_form.go
  8. func Post(where string, data *url.Values) *http.Response {
  9. resp, err := http.PostForm(where, *data)
  10. if err != nil {
  11. log.Fatalf("POST got non 200 code, %v", err)
  12. }
  13. return resp
  14. }