// MakeJWTRequest Executes HTTP request using a jwt
MakeJWTRequest Executes HTTP request using a jwt
// MakeJWTRequest Executes HTTP request using a jwt
func (conn *RestConnection) MakeJWTRequest(method string, url string, payload io.Reader, contentType string) (result *io.ReadCloser, err error) {
	endpoint := fmt.Sprintf("https://%s", url)
	req, err := http.NewRequest(method, endpoint, payload)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Authorization", "Bearer "+conn.JWT)
	if contentType != "" {
		req.Header.Add("Content-Type", contentType)
	}
	req.Header.Add("User-Agent", "Skuid-CLI/"+VERSION)
	req.Header.Add("x-skuid-public-key-endpoint", conn.Host+"/api/v1/site/verificationkey")
	resp, err := getClientForProxyURL(conn.DataServiceProxy).Do(req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != 200 {
		defer resp.Body.Close()
		return nil, httperror.New(resp.Status, resp.Body)
	}
	return &resp.Body, nil
}
func ( conn * RestConnection ) MakeJWTRequest ( method string , url string , payload io . Reader , contentType string ) ( result * io . ReadCloser , err error ) { endpoint := fmt . Sprintf ( " " , url ) req , err := http . NewRequest ( method , endpoint , payload ) if err != nil { return nil , err } req . Header . Add ( " " , " " + conn . JWT ) if contentType != " " { req . Header . Add ( " " , contentType ) } req . Header . Add ( " " , " " + VERSION ) req . Header . Add ( " " , conn . Host + " " ) resp , err := getClientForProxyURL ( conn . DataServiceProxy ) . Do ( req ) if err != nil { return nil , err } if resp . StatusCode != 200 { defer resp . Body . Close ( ) return nil , httperror . New ( resp . Status , resp . Body ) } return & resp . Body , nil }
MakeJWTRequest Executes HTTP request using a jwt
MakeJWTRequest Executes HTTP request using a jwt
// Send the public key endpoint so that warden can configure a JWT key if needed