akka-http-useragent-support


License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

com.github.dakatsuka
ArtifactId

ArtifactId

akka-http-useragent-support_2.12
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

akka-http-useragent-support
akka-http-useragent-support
Project URL

Project URL

https://github.com/dakatsuka/akka-http-useragent-support
Project Organization

Project Organization

com.github.dakatsuka
Source Code Management

Source Code Management

https://github.com/dakatsuka/akka-http-useragent-support

Download akka-http-useragent-support_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.dakatsuka/akka-http-useragent-support_2.12/ -->
<dependency>
    <groupId>com.github.dakatsuka</groupId>
    <artifactId>akka-http-useragent-support_2.12</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dakatsuka/akka-http-useragent-support_2.12/
implementation 'com.github.dakatsuka:akka-http-useragent-support_2.12:0.2.0'
// https://jarcasting.com/artifacts/com.github.dakatsuka/akka-http-useragent-support_2.12/
implementation ("com.github.dakatsuka:akka-http-useragent-support_2.12:0.2.0")
'com.github.dakatsuka:akka-http-useragent-support_2.12:jar:0.2.0'
<dependency org="com.github.dakatsuka" name="akka-http-useragent-support_2.12" rev="0.2.0">
  <artifact name="akka-http-useragent-support_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dakatsuka', module='akka-http-useragent-support_2.12', version='0.2.0')
)
libraryDependencies += "com.github.dakatsuka" % "akka-http-useragent-support_2.12" % "0.2.0"
[com.github.dakatsuka/akka-http-useragent-support_2.12 "0.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.3
is.tagomor.woothee : woothee-java jar 1.7.0
com.typesafe.akka : akka-http_2.12 jar 10.0.9

test (2)

Group / Artifact Type Version
com.typesafe.akka : akka-http-testkit_2.12 jar 10.0.9
org.scalatest : scalatest_2.12 jar 3.0.3

Project Modules

There are no modules declared in this project.

akka-http-useragent-support

Maven Central CircleCI

This library provides a way to handle UserAgent easily with Akka HTTP using woothee-java.

Getting akka-http-useragent-support

akka-http-useragent-support is available in sonatype repository and it targets Akka HTTP 10.0.x. There are scala 2.11 and 2.12 compatible jars available.

libraryDependencies += "com.github.dakatsuka" %% "akka-http-useragent-support" % "0.2.0"

Usage

import com.github.dakatsuka.akka.http.useragent.UserAgentSupport._

val route = path("foo" / "bar") {
  get {
    extractUserAgent { ua =>
      ua.toString  // "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko"
      ua.value     // "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko"
      ua.name      // "Internet Explorer"
      ua.category  // "pc"
      ua.os        // "Windows 8.1"
      ua.version   // "11.0"
      ua.vendor    // Some("Microsoft")
      ua.osVersion // Some("NT 6.3")
    }

    optionalUserAgent {
      case Some(ua) =>
      case None     =>
    }
  }
}

Authors

Versions

Version
0.2.0
0.1.0