本文整理了Java中org.mockserver.model.HttpResponse.withConnectionOptions()
方法的一些代码示例,展示了HttpResponse.withConnectionOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.withConnectionOptions()
方法的具体详情如下:
包路径:org.mockserver.model.HttpResponse
类名称:HttpResponse
方法名:withConnectionOptions
[英]The connection options for override the default connection behaviour, this allows full control of headers such as "Connection" or "Content-Length" or controlling whether the socket is closed after the response has been sent
[中]用于覆盖默认连接行为的连接选项,这允许完全控制诸如“连接”或“内容长度”之类的标题,或者控制在发送响应后是否关闭套接字
代码示例来源:origin: jamesdbloom/mockserver
public HttpResponse buildObject() {
return new HttpResponse()
.withStatusCode(statusCode)
.withReasonPhrase(reasonPhrase)
.withBody(body != null ? body.buildObject() : null)
.withHeaders(headers)
.withCookies(cookies)
.withDelay((delay != null ? delay.buildObject() : null))
.withConnectionOptions((connectionOptions != null ? connectionOptions.buildObject() : null));
}
代码示例来源:origin: jamesdbloom/mockserver
public HttpResponse clone() {
return response()
.withStatusCode(statusCode)
.withReasonPhrase(reasonPhrase)
.withBody(body)
.withHeaders(headers.clone())
.withCookies(cookies.clone())
.withDelay(getDelay())
.withConnectionOptions(connectionOptions);
}
}
代码示例来源:origin: org.mock-server/mockserver-core
public HttpResponse buildObject() {
return new HttpResponse()
.withStatusCode(statusCode)
.withReasonPhrase(reasonPhrase)
.withBody(body != null ? body.buildObject() : null)
.withHeaders(headers)
.withCookies(cookies)
.withDelay((delay != null ? delay.buildObject() : null))
.withConnectionOptions((connectionOptions != null ? connectionOptions.buildObject() : null));
}
代码示例来源:origin: org.mock-server/mockserver-core
public HttpResponse clone() {
return response()
.withStatusCode(statusCode)
.withReasonPhrase(reasonPhrase)
.withBody(body)
.withHeaders(headers.clone())
.withCookies(cookies.clone())
.withDelay(getDelay())
.withConnectionOptions(connectionOptions);
}
}
代码示例来源:origin: tote/mockserver8
public void doResponse(ForwardChainExpectation fce, EndPoint ep){
HttpResponse response = response().withStatusCode(ep.statusCode())
.withConnectionOptions(new ConnectionOptions().withKeepAliveOverride(false))
.withBody(ep.getResponseBody())
.withHeaders(ep.getResponseHeaders());
fce.respond(response);
}
内容来源于网络,如有侵权,请联系作者删除!