本文整理汇总了Java中org.mockserver.model.HttpRequest.getQueryStringParameterList方法的典型用法代码示例。如果您正苦于以下问题:Java HttpRequest.getQueryStringParameterList方法的具体用法?Java HttpRequest.getQueryStringParameterList怎么用?Java HttpRequest.getQueryStringParameterList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mockserver.model.HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.getQueryStringParameterList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serialize
import org.mockserver.model.HttpRequest; //导入方法依赖的package包/类
@Override
public void serialize(HttpRequest httpRequest, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeStartObject();
if (httpRequest.getNot() != null && httpRequest.getNot()) {
jgen.writeBooleanField("not", httpRequest.getNot());
}
if (httpRequest.getMethod() != null && !Strings.isNullOrEmpty(httpRequest.getMethod().getValue())) {
jgen.writeObjectField("method", httpRequest.getMethod());
}
if (httpRequest.getPath() != null && !Strings.isNullOrEmpty(httpRequest.getPath().getValue())) {
jgen.writeObjectField("path", httpRequest.getPath());
}
if (httpRequest.getQueryStringParameterList() != null && !httpRequest.getQueryStringParameterList().isEmpty()) {
jgen.writeObjectField("queryStringParameters", httpRequest.getQueryStringParameters());
}
if (httpRequest.getHeaderList() != null && !httpRequest.getHeaderList().isEmpty()) {
jgen.writeObjectField("headers", httpRequest.getHeaders());
}
if (httpRequest.getCookieList() != null && !httpRequest.getCookieList().isEmpty()) {
jgen.writeObjectField("cookies", httpRequest.getCookies());
}
if (httpRequest.isKeepAlive() != null) {
jgen.writeBooleanField("keepAlive", httpRequest.isKeepAlive());
}
if (httpRequest.isSecure() != null) {
jgen.writeBooleanField("secure", httpRequest.isSecure());
}
if (httpRequest.getBody() != null && !Strings.isNullOrEmpty(String.valueOf(httpRequest.getBody().getValue()))) {
jgen.writeObjectField("body", httpRequest.getBody());
}
jgen.writeEndObject();
}
示例2: getURI
import org.mockserver.model.HttpRequest; //导入方法依赖的package包/类
public String getURI(HttpRequest httpRequest) {
QueryStringEncoder queryStringEncoder = new QueryStringEncoder(httpRequest.getPath().getValue());
for (Parameter parameter : httpRequest.getQueryStringParameterList()) {
for (NottableString value : parameter.getValues()) {
queryStringEncoder.addParam(parameter.getName().getValue(), value.getValue());
}
}
return queryStringEncoder.toString();
}