hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[Question] <title>监控API接口 在获取到token之后将token 作为参数传递到第二个请求中

Open wangaocong opened this issue 1 year ago • 1 comments

Question

metrics:

  • name: auth priority: 0 fields:

    • field: access_token type: 1
    • field: refresh_token type: 1 protocol: http http: host: ^^host^^ port: ^^port^^ url: ^^uri^^ timeout: 6000 method: POST payload: ^^payload^^ headers: content-type: application/x-www-form-urlencoded parseType: jsonPath parseScript: '$'
  • name: actuator priority: 1 fields:

    • field: status type: 1 protocol: http http: host: ^^host^^ port: ^^port^^ url: ^^uri^^ timeout: ^^timeout^^ method: GET ssl: ^^ssl^^ authorization: type: Bearer Token bearerTokenToken: ^^access_token^^ parseType: jsonPath parseScript: '$'

以上是我的模板配置。当我把token 写死时是可以获取到第二个接口的返回信息,但是换成参数就提示401

wangaocong avatar Aug 20 '24 11:08 wangaocong

hi,make sure that the access_token is correctly obtained, and the access_token placeholder is'^o^ , if that still doesn't work, refer to link

pwallk avatar Aug 20 '24 14:08 pwallk