com.zarbosoft:cogettus

Asynchronous HTTP requests library for XNIO with coroutines

License

License

GroupId

GroupId

com.zarbosoft
ArtifactId

ArtifactId

cogettus
Last Version

Last Version

0.0.10
Release Date

Release Date

Type

Type

jar
Description

Description

com.zarbosoft:cogettus
Asynchronous HTTP requests library for XNIO with coroutines
Project URL

Project URL

https://github.com/rendaw/gettus
Source Code Management

Source Code Management

http://github.com/rendaw/gettus/tree/master

Download cogettus

How to add to project

<!-- https://jarcasting.com/artifacts/com.zarbosoft/cogettus/ -->
<dependency>
    <groupId>com.zarbosoft</groupId>
    <artifactId>cogettus</artifactId>
    <version>0.0.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.zarbosoft/cogettus/
implementation 'com.zarbosoft:cogettus:0.0.10'
// https://jarcasting.com/artifacts/com.zarbosoft/cogettus/
implementation ("com.zarbosoft:cogettus:0.0.10")
'com.zarbosoft:cogettus:jar:0.0.10'
<dependency org="com.zarbosoft" name="cogettus" rev="0.0.10">
  <artifact name="cogettus" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.zarbosoft', module='cogettus', version='0.0.10')
)
libraryDependencies += "com.zarbosoft" % "cogettus" % "0.0.10"
[com.zarbosoft/cogettus "0.0.10"]

Dependencies

compile (2)

Group / Artifact Type Version
com.zarbosoft : gettus jar 0.0.4
com.zarbosoft : coroutines jar 0.0.6

Project Modules

There are no modules declared in this project.

Gettus

Gettus is an asynchronous HTTP client for use with XNIO built with Undertow routines. It never starts or blocks threads. There are currently two client flavors:

  1. Gettus - an interface based on CompletableFutures
  2. Cogettus (separate artifact) - an interface for use with coroutines

This project is fairly incomplete - there's no built in session management, proxy support, or redirects but it is entirely usable. I've interacted with AWS via their HTTP API and a number of websites using Gettus and encountered no issues so far. If you'd like to try your hand at implementing these features though, PRs welcome.

Example (Cogettus)

final SensorDataArray response = new Cogettus(formatURI("http://%s/recent", sensorHost))
		.bodyJson(w -> {
			w.writeStartObject();
			w.writeNumberField("count", 100);
			w.writeEndObject();
		})
		.send(worker)
		.body()
		.check()
		.json(SensorDataArray.class);

Maven

Gettus:

<dependency>
    <groupId>com.zarbosoft</groupId>
    <artifactId>gettus</artifactId>
    <version>0.0.10</version>
</dependency>

Cogettus

<dependency>
    <groupId>com.zarbosoft</groupId>
    <artifactId>cogettus</artifactId>
    <version>0.0.10</version>
</dependency>

Versions

Version
0.0.10
0.0.9
0.0.2
0.0.1