yookue / http-client-spring-boot-starter

Http client for spring boot starter

Home Page:https://mvnrepository.com/artifact/com.yookue.springstarter/http-client-spring-boot-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Http Client Spring Boot Starter

Spring Boot application integrates HttpClient quickly.

Quickstart

  • Import dependencies
    <dependency>
        <groupId>com.yookue.springstarter</groupId>
        <artifactId>http-client-spring-boot-starter</artifactId>
        <version>LATEST</version>
    </dependency>

By default, this starter will auto take effect, you can turn it off by spring.http-client.enabled = false

  • Configure Spring Boot application.yml with prefix spring.http-client
spring:
    http-client:
        sync-client:
            user-agent: 'Apache-HttpClient'
        async-client:
            user-agent: 'Apache-HttpClient'
  • This starter creates two beans as follows, then you can configure your beans by constructor or @Autowired/@Resource annotation, then you can access it.
Bean Name Bean Class
syncHttpClient org.apache.hc.client5.http.classic.HttpClient
asyncHttpClient org.apache.hc.client5.http.async.HttpAsyncClient

Document

Requirement

  • jdk 17+

License

This project is under the Apache License 2.0

See the NOTICE.txt file for required notices and attributions.

Donation

You like this package? Then donate to Yookue to support the development.

Website

About

Http client for spring boot starter

https://mvnrepository.com/artifact/com.yookue.springstarter/http-client-spring-boot-starter

License:Apache License 2.0


Languages

Language:Java 100.0%