update auth body
This commit is contained in:
parent
8c519bbab7
commit
d33f3d7063
|
@ -55,3 +55,8 @@ type Label struct {
|
||||||
Caption string `json:"caption"`
|
Caption string `json:"caption"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AuthPayload struct {
|
||||||
|
ClientID string `json:"clientId"`
|
||||||
|
ClientSecret string `json:"clientSecret"`
|
||||||
|
}
|
||||||
|
|
|
@ -209,13 +209,10 @@ func (c *Client) CancelOutboundRequest(requestID int, note string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) auth() (*authRes, error) {
|
func (c *Client) auth() (*authRes, error) {
|
||||||
// v := url.Values{}
|
b := AuthPayload{
|
||||||
// v.Add("realm", c.realm)
|
ClientID: c.clientID,
|
||||||
// v.Add("grant_type", "client_credentials")
|
ClientSecret: c.clientSecret,
|
||||||
// v.Add("client_id", c.clientID)
|
}
|
||||||
// v.Add("client_secret", c.clientSecret)
|
|
||||||
//
|
|
||||||
// body := v.Encode()
|
|
||||||
header := map[string]string{
|
header := map[string]string{
|
||||||
httputil.HeaderKeyContentType: httputil.HeaderValueApplicationJSON,
|
httputil.HeaderKeyContentType: httputil.HeaderValueApplicationJSON,
|
||||||
}
|
}
|
||||||
|
@ -224,8 +221,8 @@ func (c *Client) auth() (*authRes, error) {
|
||||||
ResponseImmediately: true,
|
ResponseImmediately: true,
|
||||||
Payload: model.HttpRequest{
|
Payload: model.HttpRequest{
|
||||||
URL: apiURL,
|
URL: apiURL,
|
||||||
Method: http.MethodGet,
|
Method: http.MethodPost,
|
||||||
// Data: body,
|
Data: pjson.ToJSONString(b),
|
||||||
Header: header,
|
Header: header,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue