first commit of Go client

This commit is contained in:
Suraj Patil 2016-09-20 22:03:18 +05:30
parent d6b52be000
commit 4fa83089ee
2 changed files with 19 additions and 0 deletions

BIN
client/client Executable file

Binary file not shown.

19
client/main.go Normal file
View File

@ -0,0 +1,19 @@
package main
import "net/http"
import "fmt"
import "io/ioutil"
func main() {
resp, err := http.Get("http://127.0.0.1:8081/api/get-token")
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading body")
}
fmt.Println(string(body))
}