Commit 753c8032 authored by liugaoling's avatar liugaoling

authorization

parent 49638afb
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"fmt" "fmt"
"github.com/cesanta/docker_auth/auth_server/authz" "github.com/cesanta/docker_auth/auth_server/authz"
"encoding/json" "encoding/json"
"bytes"
"strconv" "strconv"
) )
...@@ -67,8 +68,9 @@ func HttpAuth(authReqInfo authz.AuthRequestInfo) bool { ...@@ -67,8 +68,9 @@ func HttpAuth(authReqInfo authz.AuthRequestInfo) bool {
client := &http.Client{} client := &http.Client{}
authUrl := "http://47.57.4.97/c3ce/dockerimage/authorization" authUrl := "http://47.57.4.97/c3ce/dockerimage/authorization"
bytesData, _ := json.Marshal(authReqInfo) bytesData, _ := json.Marshal(authReqInfo)
fmt.Println(string(bytesData)) fmt.Println(bytesData)
req, _ := http.NewRequest("POST", authUrl, bytesData) fmt.Println(authReqInfo)
req, _ := http.NewRequest("POST", authUrl, bytes.NewReader(authReqInfo))
resp, _ := client.Do(req) resp, _ := client.Do(req)
defer resp.Body.Close() 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