Commit 8462b9b9 authored by liugaoling's avatar liugaoling

authorization

parent 3409c980
......@@ -67,15 +67,11 @@ func HttpLogin(username string, password string) (bool, error) {
func HttpAuth(authReqInfo authz.AuthRequestInfo) bool {
client := &http.Client{}
authUrl := "http://47.57.4.97/c3ce/dockerimage/authorization"
authReqInfo.Account = "wln"
authReqInfo.Name = "wln/apple"
authReqInfo.Service = "wln"
fmt.Println(authReqInfo)
bytesData, _ := json.Marshal(authReqInfo)
fmt.Println(bytesData)
fmt.Println(string(bytesData))
req, _ := http.NewRequest("POST", authUrl, bytes.NewReader(bytesData))
req.Header.Set("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment