Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/enonic-docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- "master"
- "3.x"
- "4.x"
- "3.x"
paths:
- 'docs/**'
workflow_dispatch:
Expand Down
22 changes: 5 additions & 17 deletions docs/index.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= HTTP Client Library

image::https://img.shields.io/badge/xp-7.+-blue.svg[role="right"]
NOTE: Versions 4.x target XP 8+.

Easily access remote web API's and data sources over HTTP using this library.

Expand All @@ -9,7 +9,7 @@ To start using this library, add the following into your `build.gradle` file:
[source,groovy]
----
dependencies {
include 'com.enonic.lib:lib-http-client:3.2.1'
include "com.enonic.lib:lib-http-client:${libVersion}"
}
----

Expand Down Expand Up @@ -88,7 +88,7 @@ The request function takes a parameter object with options. The only mandatory o
** `*queryParams*` (_object_) Query parameters to be sent with the request.
** `*params*` (_object_) Form parameters to be sent with the request. Will not be used if `*queryParams*` is provided.
** `*headers*` (_object_) HTTP headers, an object where the keys are header names and the values the header values.
** `*disableHttp2*` (_boolean_) Disable use of HTTP/2 protocol. The default value is `false`. For insecure HTTP connections HTTP/2 is always disabled. (added in v3.2.0)
** `*disableHttp2*` (_boolean_) Disable use of HTTP/2 protocol. The default value is `false`. For insecure HTTP connections HTTP/2 is always disabled.
** `*connectionTimeout*` (_number_) The timeout on establishing the connection, in milliseconds. The default value is `10000`.
** `*readTimeout*` (_number_) The timeout on waiting to receive data, in milliseconds. The default value is `10000`.
** `*body*` (_string_ | _object_) Body content to send with the request, usually for POST or PUT requests. It can be of type string or stream.
Expand Down Expand Up @@ -120,7 +120,7 @@ The function will return a `response` object with the following properties:
* `*body*` (_string_) Body of the response as string. Null if the response content-type is not of type text.
* `*bodyStream*` (_object_) Body of the response as a stream object.

== KeyStore and TrustStore Configuration [*v3.0.0+*]
== KeyStore and TrustStore Configuration

Use JVM system properties to configure KeyStore and TrustSore:
https://docs.oracle.com/en/java/javase/11/security/java-secure-socket-extension-jsse-reference-guide.html#GUID-7D9F43B8-AABF-4C5B-93E6-3AFB18B66150
Expand Down Expand Up @@ -212,16 +212,4 @@ const response = httpClient.request({

== Compatibility

- This library is not compatible with XP releases before version 7.0. Make sure you reference the lib as `/lib/http-client`
and not as `/lib/xp/http-client` or `/site/lib/xp/http-client`.

- Starting from version 3.0.0 library Uses Java HttpClient instead of OkHttp Client.
It may introduce a few minor incompatibilities.
For instance, Default User-Agent is now JVM vendor dependent.

- Starting from version 3.0.0 library does not support Preemptive authentication.
Use `Authorization: Basic <credentials>` header instead.

- Starting from version 3.0.0 library uses Java Platform KeyStore.
It is JVM vendor specific but in most cases it is specified by `javax.net.ssl.keyStore` system property.
KeyStore Configuration is no longer applicable and `clientCertificate` can only be typeof Stream.
- Preemptive authentication is not supported. Use an `Authorization: Basic <credentials>` header instead.
4 changes: 2 additions & 2 deletions docs/versions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"versions": [
{ "label": "stable", "checkout": "3.x", "latest": true },
{ "label": "next", "checkout": "master" }
{ "label": "stable", "checkout": "4.x", "latest": true },
{ "label": "3.x", "checkout": "3.x" }
]
}
Loading