chits

chita

Лицензия

Лицензия

Группа

Группа

com.clouway.http
Идентификатор

Идентификатор

chita
Последняя версия

Последняя версия

1.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

chits
chita
Система контроля версий

Система контроля версий

https://github.com/clouway/chita

Скачать chita

Имя Файла Размер
chita-1.4.pom
chita-1.4.jar 15 KB
chita-1.4-sources.jar 7 KB
chita-1.4-javadoc.jar 415 KB
Обзор

Как подключить последнюю версию

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.google.inject : guice jar 3.0
javax.inject : javax.inject jar
com.google.guava : guava jar 27.1-jre

test (7)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.jmock : jmock jar 2.6.0
org.jmock : jmock-junit4 jar 2.6.0
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3
org.mortbay.jetty : jetty jar 6.1.18
com.google.code.gson : gson jar 2.3.1

Модули Проекта

Данный проект не имеет модулей.

CHITA

####Clouway Http Intelligent Transport Api

Join the chat at https://gitter.im/clouway/chita

The library represent a wrapper of the java.net.HttpURLConnection class. The main goal is to represent a builder style for construction of http requests and sending different objects by POST/GET/PUT/DELETE method using Sitebricks-like Transport.

Example:

GET

HttpRequest request = httpRequest(new TargetUrl("abv.bg")).build();
HttpClient chitaClient = new HttpClient();// in most cases chitaClient should be injected
HttpResponse response = chitaClient.execute(request);

POST

TargetUrl targetUrl = new TargetUrl("http://telcong.com", "/test/address");
HttpRequest request = httpRequest(targetUrl).post(person).as(GsonTransport.class).build();
HttpClient chitaClient = new HttpClient();// in most cases chitaClient should be injected
HttpResponse response = chitaClient.execute(request);

PUT with parameterized url

TargetUrl targetUrl = TargetUrl.urlTemplate("http://telcong.com", "/test/address/:address").setValue("address", "Veliko Turnovo").build();
HttpRequest request = httpRequest(targetUrl).put(person).as(GsonTransport.class).build();
HttpClient chitaClient = new HttpClient();// in most cases chitaClient should be injected
HttpResponse response = chitaClient.execute(request);

DELETE with parameterized url

TargetUrl targetUrl = TargetUrl.urlTemplate("http://telcong.com", "/test/device/:deviceId").setValue("deviceId", "12345").build();
HttpRequest request = httpRequest(targetUrl).delete().build();
HttpClient chitaClient = new HttpClient();// in most cases chitaClient should be injected
HttpResponse response = chitaClient.execute(request);

Also there is a way to read an object from the response or the whole response as byte array.

Result reply = response.read(Result.class).as(GsonTransport.class);
...
byte[] reply = response.readBytes();
The api works successfully with http and https, also is fully compatible with the Google App Engine platform.
com.clouway.http

clouWay ood

Версии библиотеки

Версия
1.4
1.2