Example usage for io.vertx.core.http HttpHeaders USER_AGENT

List of usage examples for io.vertx.core.http HttpHeaders USER_AGENT

Introduction

In this page you can find the example usage for io.vertx.core.http HttpHeaders USER_AGENT.

Prototype

CharSequence USER_AGENT

To view the source code for io.vertx.core.http HttpHeaders USER_AGENT.

Click Source Link

Document

User-Agent header name

Usage

From source file:com.thesoftwarefactory.vertx.web.more.impl.WebContextImpl.java

License:Apache License

@Override
public DeviceInfo deviceInfo() {
    if (deviceInfo == null) {
        String userAgent = routingContext.request().getHeader(HttpHeaders.USER_AGENT.toString());
        String httpAccept = routingContext.request().getHeader(HttpHeaders.ACCEPT.toString());
        deviceInfo = new DeviceInfoMobileEsp(userAgent, httpAccept);
    }/*from w ww.j  a  v  a2s. c o  m*/
    return deviceInfo;
}