Last active
September 11, 2018 06:18
-
-
Save yukpiz/c14bbd185922f8c3c94cb2b956b609b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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