URL中传递查询字符串参数

URL中传递查询字符串参数

本文介绍了如何使用Rest Assured在GET URL中传递查询字符串参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Rest Assured在GET URL中传递查询字符串参数?

How to pass Query String Parameters in GET url using Rest Assured?

URL是:http://example.com/building

我的查询字符串是:

globalDates:{"startMs":1473672973818,"endMs":1481448973817,"period":90}
limitTo:6
loadTvData:true
startFrom:0
userId:5834fb36981baacb6a876427

推荐答案

您可以将它们作为queryParam传递..

You can pass them as a queryParam ..

given()
.queryParam("globalDates", "{\"startMs\":1473672973818,\"endMs\":1481448973817,\"period\":90}")
.queryParam("startFrom", "0").queryParam("limitTo", "6").queryParam("loadTvData", true)
.queryParam("startFrom", "0").queryParam("userId", "5834fb36981baacb6a876427")
.when().get("http://example.com/building"). ...

这篇关于如何使用Rest Assured在GET URL中传递查询字符串参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 23:00