【问题标题】:How to send bearer token authorization in rest assured for api testing如何放心发送不记名令牌授权进行api测试
【发布时间】:2020-01-07 07:50:34
【问题描述】:

在我的应用程序中,我需要在接听电话之前将不记名令牌作为authorization 发送

我试过了

RestAssured.given().auth().oauth2(token).when().get("/search").then().assertThat().statusCode(200);

【问题讨论】:

标签: api automation rest-assured bearer-token


【解决方案1】:

这个应该可以的

RestAssured.given().header("Authorization", "bearer " + token).when().get("/search").then().assertThat().statusCode(200);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-29
    • 2018-09-22
    • 2017-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-01
    • 1970-01-01
    相关资源
    最近更新 更多