Java SDK
SDK Installation
Getting started
JDK 11 or later is required.
The samples below show how a published SDK artifact is used:
Gradle:
|
|
Maven:
|
|
How to build
After cloning the git repository to your file system you can build the SDK artifact from source to the build
directory by running ./gradlew build
on *nix systems or gradlew.bat
on Windows systems.
If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally):
On *nix:
|
|
On Windows:
|
|
Logging
A logging framework/facade has not yet been adopted but is under consideration.
For request and response logging (especially json bodies) use:
|
|
Example output:
|
|
WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via SpeakeasyHTTPClient.setRedactedHeaders
.
Another option is to set the System property -Djdk.httpclient.HttpClient.log=all
. However, this second option does not log bodies.