本文整理了Java中org.simpleframework.http.Request.getQuery
方法的一些代码示例,展示了Request.getQuery
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getQuery
方法的具体详情如下:
包路径:org.simpleframework.http.Request
类名称:Request
方法名:getQuery
暂无
代码示例来源:origin: jersey/jersey
private URI getRequestUri(final Request request, final URI baseUri) {
try {
final String serverAddress = getServerAddress(baseUri);
String uri = ContainerUtils.getHandlerPath(request.getTarget());
final String queryString = request.getQuery().toString();
if (queryString != null) {
uri = uri + "?" + ContainerUtils.encodeUnsafeCharacters(queryString);
}
return new URI(serverAddress + uri);
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex);
}
}
代码示例来源:origin: org.simpleframework/simple
/**
* This method is used to acquire the query part from the HTTP
* request URI target and a form post if it exists. Both the
* query and the form post are merge together in a single query.
*
* @return the query associated with the HTTP target URI
*/
public Query getQuery() {
return request.getQuery();
}
代码示例来源:origin: org.simpleframework/simple-http
/**
* This method is used to acquire the query part from the HTTP
* request URI target and a form post if it exists. Both the
* query and the form post are merge together in a single query.
*
* @return the query associated with the HTTP target URI
*/
public Query getQuery() {
return request.getQuery();
}
代码示例来源:origin: ngallagher/simpleframework
/**
* This method is used to acquire the query part from the HTTP
* request URI target and a form post if it exists. Both the
* query and the form post are merge together in a single query.
*
* @return the query associated with the HTTP target URI
*/
public Query getQuery() {
return request.getQuery();
}
代码示例来源:origin: restx/restx
@Override
public List<String> getQueryParams(String param) {
List<String> queryParams = request.getQuery().getAll(param);
return queryParams==null?null:Lists.newArrayList(queryParams);
}
代码示例来源:origin: restx/restx
@Override
public Optional<String> getQueryParam(String param) {
return Optional.fromNullable(request.getQuery().get(param));
}
代码示例来源:origin: io.restx/restx-server-simple
@Override
public List<String> getQueryParams(String param) {
List<String> queryParams = request.getQuery().getAll(param);
return queryParams==null?null:Lists.newArrayList(queryParams);
}
代码示例来源:origin: CodeStory/fluent-http
@Override
public Query query() {
return new SimpleQuery(request.getQuery());
}
代码示例来源:origin: io.restx/restx-server-simple
@Override
public Optional<String> getQueryParam(String param) {
return Optional.fromNullable(request.getQuery().get(param));
}
代码示例来源:origin: lantunes/fixd
public Set<String> getRequestParameterNames() {
return request.getQuery().keySet();
}
代码示例来源:origin: lantunes/fixd
public String getQuery() {
return request.getQuery().toString();
}
代码示例来源:origin: restx/restx
@Override
public ImmutableMap<String, ImmutableList<String>> getQueryParams() {
if (queryParams == null) {
ImmutableMap.Builder<String, ImmutableList<String>> paramsBuilder = ImmutableMap.builder();
Query query = request.getQuery();
for (String param : query.keySet()) {
paramsBuilder.put(param, ImmutableList.copyOf(query.getAll(param)));
}
queryParams = paramsBuilder.build();
}
return queryParams;
}
代码示例来源:origin: io.restx/restx-server-simple
@Override
public ImmutableMap<String, ImmutableList<String>> getQueryParams() {
if (queryParams == null) {
ImmutableMap.Builder<String, ImmutableList<String>> paramsBuilder = ImmutableMap.builder();
Query query = request.getQuery();
for (String param : query.keySet()) {
paramsBuilder.put(param, ImmutableList.copyOf(query.getAll(param)));
}
queryParams = paramsBuilder.build();
}
return queryParams;
}
代码示例来源:origin: restx/restx
@Override
public String getRestxUri() {
return getRestxPath() + (request.getQuery().isEmpty() ? "" : "?" + request.getQuery().toString());
}
代码示例来源:origin: io.restx/restx-server-simple
@Override
public String getRestxUri() {
return getRestxPath() + (request.getQuery().isEmpty() ? "" : "?" + request.getQuery().toString());
}
代码示例来源:origin: org.glassfish.jersey.containers/jersey-container-simple-http
private URI getRequestUri(final Request request, final URI baseUri) {
try {
final String serverAddress = getServerAddress(baseUri);
String uri = ContainerUtils.getHandlerPath(request.getTarget());
final String queryString = request.getQuery().toString();
if (queryString != null) {
uri = uri + "?" + ContainerUtils.encodeUnsafeCharacters(queryString);
}
return new URI(serverAddress + uri);
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex);
}
}
代码示例来源:origin: opendedup/sdfs
FrameChannel socket = connection.getChannel();
Request req = connection.getRequest();
String password = req.getQuery().get("password");
String vol = req.getQuery().get("volumeid");
boolean auth = false;
if (vol == null) {
代码示例来源:origin: opendedup/sdfs
FrameChannel socket = connection.getChannel();
Request req = connection.getRequest();
String password = req.getQuery().get("password");
String vol = req.getQuery().get("volumeid");
boolean auth = false;
if (vol == null) {
代码示例来源:origin: miltonio/milton2
@Override
public void parseRequestParameters(Map<String, String> params, Map<String, FileItem> files) throws RequestParseException {
Map map = baseRequest.getQuery();
params.putAll(map);
代码示例来源:origin: kristofa/mock-http-server
public static FullHttpRequest convert(final Request request) {
byte[] data = null;
try {
final InputStream inputStream = request.getInputStream();
try {
data = IOUtils.toByteArray(inputStream);
} finally {
inputStream.close();
}
} catch (final IOException e) {
LOGGER.error("IOException when getting request content.", e);
}
final FullHttpRequestImpl httpRequest = new FullHttpRequestImpl();
httpRequest.domain(request.getAddress().getDomain());
httpRequest.port(request.getAddress().getPort());
httpRequest.method(Method.valueOf(request.getMethod()));
httpRequest.path(request.getPath().getPath());
if (data.length > 0) {
httpRequest.content(data);
}
for (final String headerField : request.getNames()) {
for (final String headerFieldValue : request.getValues(headerField)) {
httpRequest.httpMessageHeader(headerField, headerFieldValue);
}
}
for (final Entry<String, String> entry : request.getQuery().entrySet()) {
httpRequest.queryParameter(entry.getKey(), entry.getValue());
}
return httpRequest;
}
内容来源于网络,如有侵权,请联系作者删除!