org.glassfish.grizzly.http.server.Request.getContentType()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(176)

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

Request.getContentType介绍

[英]Return the content type for this Request.
[中]返回此请求的内容类型。

代码示例

代码示例来源:origin: org.glassfish.main.web/web-core

  1. /**
  2. * Return the content type for this Request.
  3. */
  4. @Override
  5. public String getContentType() {
  6. return coyoteRequest.getContentType();
  7. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContentType() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return request.getContentType();
  10. }

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

  1. @Override
  2. public String getContentType() {
  3. String s = wrapped.getContentType();
  4. if( s == null ) {
  5. s = StandardCharsets.UTF_8.name();
  6. }
  7. return s;
  8. }

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

  1. protected Response.ContentType getRequestContentType() {
  2. String s = wrapped.getContentType();
  3. log.trace("request content type", s);
  4. if (s == null) {
  5. return null;
  6. }
  7. if (s.contains(Response.MULTIPART)) {
  8. return Response.ContentType.MULTIPART;
  9. }
  10. return typeContents.get(s);
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. final CompletionHandler<Request> completionHandler) {
  2. try {
  3. final String contentType = request.getContentType();
  4. if (contentType == null) {
  5. throw new IllegalStateException("ContentType not found");

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-multipart

  1. final CompletionHandler<Request> completionHandler) {
  2. try {
  3. final String contentType = request.getContentType();
  4. if (contentType == null) {
  5. throw new IllegalStateException("ContentType not found");

代码示例来源:origin: javaee/grizzly

  1. final CompletionHandler<Request> completionHandler) {
  2. try {
  3. final String contentType = request.getContentType();
  4. if (contentType == null) {
  5. throw new IllegalStateException("ContentType not found");

代码示例来源:origin: javaee/grizzly

  1. final CompletionHandler<Request> completionHandler) {
  2. try {
  3. final String contentType = request.getContentType();
  4. if (contentType == null) {
  5. throw new IllegalStateException("ContentType not found");

代码示例来源:origin: com.xebialabs.restito/restito

  1. /**
  2. * Factory method
  3. */
  4. public static Call fromRequest(final Request request) {
  5. Call call = new Call();
  6. call.request = request;
  7. call.method = request.getMethod();
  8. call.authorization = request.getAuthorization();
  9. call.uri = request.getRequestURI();
  10. call.contentType = request.getContentType();
  11. call.url = request.getRequestURL().toString();
  12. for (String headerName : request.getHeaderNames()) {
  13. List<String> headers = new ArrayList<>();
  14. request.getHeaders(headerName).forEach(headers::add);
  15. call.headers.put(headerName, headers);
  16. }
  17. call.parameters = new HashMap<>(request.getParameterMap());
  18. try {
  19. call.postBody = request.getPostBody(999999).toStringContent(Charset.defaultCharset());
  20. } catch (IOException e) {
  21. throw new RuntimeException("Problem reading Post Body of HTTP call");
  22. }
  23. return call;
  24. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. if (!checkPostContentType(getContentType())) return;

代码示例来源:origin: javaee/grizzly

  1. if (!checkPostContentType(getContentType())) return;

代码示例来源:origin: javaee/grizzly

  1. if (!checkPostContentType(getContentType())) return;

代码示例来源:origin: javaee/grizzly

  1. if (!checkPostContentType(getContentType())) return;

代码示例来源:origin: javaee/grizzly

  1. if (!checkPostContentType(getContentType())) return;

代码示例来源:origin: javaee/grizzly

  1. if (!checkPostContentType(getContentType())) return;

相关文章

Request类方法