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