/go-post-example

Golang example to do HTTP POST request from client and handle the request in server side.

Primary LanguageGoMIT LicenseMIT

go-post-example

Build Status Go Report Card

Golang example to do HTTP POST request from client and handle the request in server side.

Client

  • Values.Encode() encodes the values into “URL encoded” form ("bar=baz&foo=quux") sorted by key.
  • POST JSON to server and read response.

Server

  • Request.ParseForm() will parse form data and update Request.PostForm.
  • Unmarshal JSON from POST data to a struct.