0

I'm writing tests against an API that hmacsha1 hashes the entire get request query string using a secret key and sends it in the header. So I need to compute for this value, set it in the header, before executing the test. like this:

expect()
        .statusCode(200)
.given()
        .parameter("key", "abc")
        .parameter("param2", "def")
        .header("Authorization",hmacsha1(queryString,"secretKey"))
.when()
        .get("/endpoint");

Is there a way I can access the current query string at the "queryString" location? basically it should give me "key=abc&param2=def" so I can hash it in-place.

Thanks a lot!

4

1 回答 1

0

也许您可以在请求发送到服务器之前使用过滤器并对查询参数进行哈希处理?

于 2015-03-22T19:48:45.333 回答