url := "https://test.xx.jp/api/v2/tickets/password-change"
payload := strings.NewReader("{\"user_id\": \"auth0|64265f14712a5faae1efefsfe\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Bearer eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLWRldi5lbGdhbmEuanAvIn0..3sAOsAQeLiI3M5IK.c-deafda-pG1g0ZkbzX7LFv3ZRM8lI1Es7z_HdfJth-cz-JTRwrz1yBTp7Z7A2enVgpnNh4e3mJ_7YgOyqB9H8EKbWbded54WbEitSaFvcRiPxc3CC3mI0mvmZXtHgaD_bRju_x-8h09DIIX_h0u3hcwOE3DF_9Jb8uq4SrvXsO-Or-IgLt_kga3jeld-UrNb1yYh1rhLySDXOo5KBul-lV5qIb8aMkTXIwCZAFWncw9JgBLEfT_zVFx8gYV7AZ6A9mnmIkyOMxC7b_0mZyqefnMYqnu9M08.puvtlPKmBoBK1V58pnyTVQ")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
输出结果为:
{"statusCode":400,"error":"Bad Request","message":"Bad HTTP authentication header format","errorCode":"Bearer"}
如果需要添加其他参数的话,应该加哪个,参数的值又是多少呢?