Skip to content

Commit

Permalink
rm incorect docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed Oct 9, 2023
1 parent f0e6ffa commit 1fc8581
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ rightmenu: true
- [Caching](#caching)
- [Configuration](#configuration)
- [Config Options](#config-options)
- [Custom Apache Clients](#custom-apache-clients)
- [Multiple Configurations](#multiple-configurations)
- [Object Mappers](#object-mappers)
- [Metrics](#metrics)
Expand Down Expand Up @@ -560,7 +559,7 @@ All configuration is now done through ```Unirest.config()```
.addInterceptor(new MyCustomInterceptor());
```

Changing Unirest's config should ideally be done once, or rarely. There are several background threads spawned by both Unirest itself and Apache HttpAsyncClient. Once Unirest has been activated configuration options that are involved in creating the client cannot be changed without an explicit shutdown or reset.
Changing Unirest's config should ideally be done once, or rarely. Once Unirest has been activated configuration options that are involved in creating the client cannot be changed without an explicit shutdown or reset.



Expand Down Expand Up @@ -595,27 +594,6 @@ This can be useful for logging or injecting common attributes.

See [Interceptor.java](https://github.com/Kong/unirest-java/blob/master/unirest/src/main/java/kong/unirest/Interceptor.java) for details.

## Custom Apache Clients
Unirest leverages Apache Http Client under the hood, this is not considered to be a permemant requirement and future versions of Unirest may replace Apache with something else.

You can set your own custom Apache HttpClient and HttpAsyncClient.
Note that Unirest settings like timeouts or interceptors are not applied to custom clients.

```java
Unirest.config()
.httpClient(ApacheClient.builder(myClient))
.asyncClient(ApacheAsyncClient.builder(myAsyncClient));
```

You can also override Unirest's implementation of the Apache request config

```java
Unirest.config()
.httpClient(ApacheClient.builder(client)
.withRequestConfig((c,r) -> RequestConfig.custom().build()
);
```


## Multiple Configurations
As usual, Unirest maintains a primary single instance. Sometimes you might want different configurations for different systems. You might also want an instance rather than a static context for testing purposes.
Expand Down

0 comments on commit 1fc8581

Please sign in to comment.