org.simpleframework.http.Request.getQuery()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(264)

本文整理了Java中org.simpleframework.http.Request.getQuery方法的一些代码示例,展示了Request.getQuery的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getQuery方法的具体详情如下:
包路径:org.simpleframework.http.Request
类名称:Request
方法名:getQuery

Request.getQuery介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

  1. private URI getRequestUri(final Request request, final URI baseUri) {
  2. try {
  3. final String serverAddress = getServerAddress(baseUri);
  4. String uri = ContainerUtils.getHandlerPath(request.getTarget());
  5. final String queryString = request.getQuery().toString();
  6. if (queryString != null) {
  7. uri = uri + "?" + ContainerUtils.encodeUnsafeCharacters(queryString);
  8. }
  9. return new URI(serverAddress + uri);
  10. } catch (URISyntaxException ex) {
  11. throw new IllegalArgumentException(ex);
  12. }
  13. }

代码示例来源:origin: org.simpleframework/simple

  1. /**
  2. * This method is used to acquire the query part from the HTTP
  3. * request URI target and a form post if it exists. Both the
  4. * query and the form post are merge together in a single query.
  5. *
  6. * @return the query associated with the HTTP target URI
  7. */
  8. public Query getQuery() {
  9. return request.getQuery();
  10. }

代码示例来源:origin: org.simpleframework/simple-http

  1. /**
  2. * This method is used to acquire the query part from the HTTP
  3. * request URI target and a form post if it exists. Both the
  4. * query and the form post are merge together in a single query.
  5. *
  6. * @return the query associated with the HTTP target URI
  7. */
  8. public Query getQuery() {
  9. return request.getQuery();
  10. }

代码示例来源:origin: ngallagher/simpleframework

  1. /**
  2. * This method is used to acquire the query part from the HTTP
  3. * request URI target and a form post if it exists. Both the
  4. * query and the form post are merge together in a single query.
  5. *
  6. * @return the query associated with the HTTP target URI
  7. */
  8. public Query getQuery() {
  9. return request.getQuery();
  10. }

代码示例来源:origin: restx/restx

  1. @Override
  2. public List<String> getQueryParams(String param) {
  3. List<String> queryParams = request.getQuery().getAll(param);
  4. return queryParams==null?null:Lists.newArrayList(queryParams);
  5. }

代码示例来源:origin: restx/restx

  1. @Override
  2. public Optional<String> getQueryParam(String param) {
  3. return Optional.fromNullable(request.getQuery().get(param));
  4. }

代码示例来源:origin: io.restx/restx-server-simple

  1. @Override
  2. public List<String> getQueryParams(String param) {
  3. List<String> queryParams = request.getQuery().getAll(param);
  4. return queryParams==null?null:Lists.newArrayList(queryParams);
  5. }

代码示例来源:origin: CodeStory/fluent-http

  1. @Override
  2. public Query query() {
  3. return new SimpleQuery(request.getQuery());
  4. }

代码示例来源:origin: io.restx/restx-server-simple

  1. @Override
  2. public Optional<String> getQueryParam(String param) {
  3. return Optional.fromNullable(request.getQuery().get(param));
  4. }

代码示例来源:origin: lantunes/fixd

  1. public Set<String> getRequestParameterNames() {
  2. return request.getQuery().keySet();
  3. }

代码示例来源:origin: lantunes/fixd

  1. public String getQuery() {
  2. return request.getQuery().toString();
  3. }

代码示例来源:origin: restx/restx

  1. @Override
  2. public ImmutableMap<String, ImmutableList<String>> getQueryParams() {
  3. if (queryParams == null) {
  4. ImmutableMap.Builder<String, ImmutableList<String>> paramsBuilder = ImmutableMap.builder();
  5. Query query = request.getQuery();
  6. for (String param : query.keySet()) {
  7. paramsBuilder.put(param, ImmutableList.copyOf(query.getAll(param)));
  8. }
  9. queryParams = paramsBuilder.build();
  10. }
  11. return queryParams;
  12. }

代码示例来源:origin: io.restx/restx-server-simple

  1. @Override
  2. public ImmutableMap<String, ImmutableList<String>> getQueryParams() {
  3. if (queryParams == null) {
  4. ImmutableMap.Builder<String, ImmutableList<String>> paramsBuilder = ImmutableMap.builder();
  5. Query query = request.getQuery();
  6. for (String param : query.keySet()) {
  7. paramsBuilder.put(param, ImmutableList.copyOf(query.getAll(param)));
  8. }
  9. queryParams = paramsBuilder.build();
  10. }
  11. return queryParams;
  12. }

代码示例来源:origin: restx/restx

  1. @Override
  2. public String getRestxUri() {
  3. return getRestxPath() + (request.getQuery().isEmpty() ? "" : "?" + request.getQuery().toString());
  4. }

代码示例来源:origin: io.restx/restx-server-simple

  1. @Override
  2. public String getRestxUri() {
  3. return getRestxPath() + (request.getQuery().isEmpty() ? "" : "?" + request.getQuery().toString());
  4. }

代码示例来源:origin: org.glassfish.jersey.containers/jersey-container-simple-http

  1. private URI getRequestUri(final Request request, final URI baseUri) {
  2. try {
  3. final String serverAddress = getServerAddress(baseUri);
  4. String uri = ContainerUtils.getHandlerPath(request.getTarget());
  5. final String queryString = request.getQuery().toString();
  6. if (queryString != null) {
  7. uri = uri + "?" + ContainerUtils.encodeUnsafeCharacters(queryString);
  8. }
  9. return new URI(serverAddress + uri);
  10. } catch (URISyntaxException ex) {
  11. throw new IllegalArgumentException(ex);
  12. }
  13. }

代码示例来源:origin: opendedup/sdfs

  1. FrameChannel socket = connection.getChannel();
  2. Request req = connection.getRequest();
  3. String password = req.getQuery().get("password");
  4. String vol = req.getQuery().get("volumeid");
  5. boolean auth = false;
  6. if (vol == null) {

代码示例来源:origin: opendedup/sdfs

  1. FrameChannel socket = connection.getChannel();
  2. Request req = connection.getRequest();
  3. String password = req.getQuery().get("password");
  4. String vol = req.getQuery().get("volumeid");
  5. boolean auth = false;
  6. if (vol == null) {

代码示例来源:origin: miltonio/milton2

  1. @Override
  2. public void parseRequestParameters(Map<String, String> params, Map<String, FileItem> files) throws RequestParseException {
  3. Map map = baseRequest.getQuery();
  4. params.putAll(map);

代码示例来源:origin: kristofa/mock-http-server

  1. public static FullHttpRequest convert(final Request request) {
  2. byte[] data = null;
  3. try {
  4. final InputStream inputStream = request.getInputStream();
  5. try {
  6. data = IOUtils.toByteArray(inputStream);
  7. } finally {
  8. inputStream.close();
  9. }
  10. } catch (final IOException e) {
  11. LOGGER.error("IOException when getting request content.", e);
  12. }
  13. final FullHttpRequestImpl httpRequest = new FullHttpRequestImpl();
  14. httpRequest.domain(request.getAddress().getDomain());
  15. httpRequest.port(request.getAddress().getPort());
  16. httpRequest.method(Method.valueOf(request.getMethod()));
  17. httpRequest.path(request.getPath().getPath());
  18. if (data.length > 0) {
  19. httpRequest.content(data);
  20. }
  21. for (final String headerField : request.getNames()) {
  22. for (final String headerFieldValue : request.getValues(headerField)) {
  23. httpRequest.httpMessageHeader(headerField, headerFieldValue);
  24. }
  25. }
  26. for (final Entry<String, String> entry : request.getQuery().entrySet()) {
  27. httpRequest.queryParameter(entry.getKey(), entry.getValue());
  28. }
  29. return httpRequest;
  30. }

相关文章