JSON functionality for ktor HTTP clients

This library provides ktor client interface integration for the json-kotlin library.

Лицензия

Лицензия

Категории

Категории

Сеть CLI Взаимодействие с пользователем JSON Данные
Группа

Группа

net.pwall.json
Идентификатор

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

json-ktor-client
Последняя версия

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

0.7
Дата

Дата

Тип

Тип

jar
Описание

Описание

JSON functionality for ktor HTTP clients
This library provides ktor client interface integration for the json-kotlin library.
Ссылка на сайт

Ссылка на сайт

https://github.com/pwall567/json-ktor-client
Система контроля версий

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

https://github.com/pwall567/json-ktor-client.git

Скачать json-ktor-client

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

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

Зависимости

compile (11)

Идентификатор библиотеки Тип Версия
net.pwall.json : json-ktor jar 1.3
net.pwall.json : json-kotlin jar 4.2
net.pwall.json : jsonutil jar 5.0
net.pwall.json : json-stream jar 0.8
net.pwall.util : pipelines jar 0.9
net.pwall.util : co-pipelines jar 0.6
net.pwall.json : json-co-stream jar 0.5
io.ktor : ktor-server-core jar 1.4.0
io.ktor : ktor-client-json-jvm jar 1.4.0
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.0
org.jetbrains.kotlin : kotlin-reflect jar 1.4.0

test (3)

Идентификатор библиотеки Тип Версия
io.ktor : ktor-client-mock jar 1.4.0
io.ktor : ktor-server-test-host jar 1.4.0
net.pwall.json : json-kotlin-test-classes jar 1.6

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

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

json-ktor-client

Build Status License: MIT Kotlin Maven Central

JSON functionality for ktor HTTP clients

This library provides ktor client interface integration for the json-kotlin library.

Quick Start

In the HttpClient engine specification, use:

    val client = HttpClient(HttpClientEngine) {
        Json {
            jsonKtorClient {}
        }
    }

Customizations (e.g custom serialization or deserialization) may be specified within the lambda supplied to the jsonKtorClient function:

    val client = HttpClient(HttpClientEngine) {
        Json {
            jsonKtorClient {
                fromJSON { json ->
                    require(json is JSONObject) { "Must be JSONObject" }
                    Example(json.getString("custom1"), json.getInt("custom2"))
                }
            }
        }
    }

For more details see the json-kotlin library.

Streaming Input

From version 0.2 onwards, this library uses the json-streaming library for on-the-fly JSON parsing. This means that the input data is parsed into an internal form as it is being read, and avoids the need to allocate memory for the entire JSON text.

Streaming Output

From version 0.5, the library will (optionally) stream output using a non-blocking output library (json-kotlin-nonblocking).

More documentation will be available shortly; in the meantime the unit test classes contain examples.

Dependency Specification

The latest version of the library is 0.7, and it may be obtained from the Maven Central repository.

Maven

    <dependency>
      <groupId>net.pwall.json</groupId>
      <artifactId>json-ktor-client</artifactId>
      <version>0.7</version>
    </dependency>

Gradle

    implementation 'net.pwall.json:json-ktor-client:0.7'

Gradle (kts)

    implementation("net.pwall.json:json-ktor-client:0.7")

Peter Wall

2021-04-25

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

Версия
0.7
0.6
0.5.1
0.5
0.4
0.3.1
0.3
0.2
0.1