Skip to content

Instantly share code, notes, and snippets.

@yukpiz
Last active September 11, 2018 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukpiz/c14bbd185922f8c3c94cb2b956b609b4 to your computer and use it in GitHub Desktop.
Save yukpiz/c14bbd185922f8c3c94cb2b956b609b4 to your computer and use it in GitHub Desktop.
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
name := flag.String("name", "", "Name")
flag.Parse()
resp, err := http.Get(fmt.Sprintf("http://localhost:8080/Profile/%s", *name))
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(bytes))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment