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

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

本文整理了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

/**
 * Return the content type for this Request.
 */
@Override
public String getContentType() {
  return coyoteRequest.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

/**
 * {@inheritDoc}
 */
@Override
public String getContentType() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getContentType();
}

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

@Override
public String getContentType() {
  String s = wrapped.getContentType();
  if( s == null ) {
    s = StandardCharsets.UTF_8.name();
  }
  return s;
  
}

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

protected Response.ContentType getRequestContentType() {
    String s = wrapped.getContentType();
    log.trace("request content type", s);
    if (s == null) {
      return null;
    }
    if (s.contains(Response.MULTIPART)) {
      return Response.ContentType.MULTIPART;
    }
    return typeContents.get(s);
  }
}

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

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

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

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

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

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

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

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

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

/**
 * Factory method
 */
public static Call fromRequest(final Request request) {
  Call call = new Call();
  call.request = request;
  call.method = request.getMethod();
  call.authorization = request.getAuthorization();
  call.uri = request.getRequestURI();
  call.contentType = request.getContentType();
  call.url = request.getRequestURL().toString();
  for (String headerName : request.getHeaderNames()) {
    List<String> headers = new ArrayList<>();
    request.getHeaders(headerName).forEach(headers::add);
    call.headers.put(headerName, headers);
  }
  call.parameters = new HashMap<>(request.getParameterMap());
  try {
    call.postBody = request.getPostBody(999999).toStringContent(Charset.defaultCharset());
  } catch (IOException e) {
    throw new RuntimeException("Problem reading Post Body of HTTP call");
  }
  return call;
}

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

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

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

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

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

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

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

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

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

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

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

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

相关文章

Request类方法