mirror of
https://github.com/thewhitetulip/Tasks.git
synced 2025-04-26 13:49:18 +08:00
first commit of Go client
This commit is contained in:
parent
d6b52be000
commit
4fa83089ee
BIN
client/client
Executable file
BIN
client/client
Executable file
Binary file not shown.
19
client/main.go
Normal file
19
client/main.go
Normal 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))
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user