http-interface-clients
/http-interface-clients
Use when calling external HTTP APIs from Spring Boot 4 / Spring Framework 7 with declarative HttpExchange interfaces. Covers ImportHttpServices, grouped base URLs and timeouts, and RestClient versus WebClient selection.
- Author
- rrezartprebreza ↗
- Repository
- spring-boot-skills ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 2
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 2 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: examples/bad-order-client.java, examples/good-order-client.java
What it does and when to use it
Use when calling external HTTP APIs from Spring Boot 4 / Spring Framework 7 with declarative HttpExchange interfaces. Covers ImportHttpServices, grouped base URLs and timeouts, and RestClient versus WebClient selection.
Original author description
Use when calling external HTTP APIs from Spring Boot 4 / Spring Framework 7 with declarative HttpExchange interfaces. Covers ImportHttpServices, grouped base URLs and timeouts, and RestClient versus WebClient selection.
How it works
- Define and register the interface
- Configure groups and transport
- Gotchas
SKILL.md preview
---
name: http-interface-clients
description: >
Use when calling external HTTP APIs from Spring Boot 4 / Spring Framework 7 with declarative
HttpExchange interfaces. Covers ImportHttpServices, grouped base URLs and timeouts, and
RestClient versus WebClient selection.
---
# Declarative HTTP Interface Clients (Boot 4)
Define a remote API as an interface with `@HttpExchange` methods. Boot 4 registers the proxy with
`@ImportHttpServices`, so do not create a manual factory for every client.
## Define and register the interface
```java
@HttpExchange("/orders")
public interface OrderApiClient {
@GetExchange("/{id}")
OrderDto get(@PathVariable UUID id);
@PostExchange
OrderDto create(@RequestBody CreateOrderRequest request);
}
@SpringBootApplication
@ImportHttpServices(group = "orders", basePackages = "com.example.client.orders")
public class Application { }
```
Inject `OrderApiClient` like any other bean. The interface needs no `@Component` and no
implementation class.
## Configure groups and transport
```yaml
spring:
http:
clients:
connect-timeout: 2s
read-timeout: 5s
serviceclient:
orders:
base-url: https://orders.internal.example.com
read-timeout: 10s
```
`spring.http.clients.*` contains global transport defaults. `spring.http.serviceclient.<group>.*`
contains per-group settings, and the group name must match `@ImportHttpServices`.
The default client type is blocking `RestClient`. Select
`HttpServiceGroup.ClientType.WEB_CLIENT` for interfaces returning `Mono` or `Flux`, and include
the WebClient starter. Group configurers apply to a group, not one interface.
Manual `HttpServiceProxyFactory` wiring remains valid for one-off clients, but it is the Boot 3
pattern and should not be the default in Boot 4.
## Gotchas
- Agent creates a `HttpServiceProxyFactory` bean for every client - use `@ImportHttpServices` and groups.
- Agent adds `@Component` or an implementation to the interface - generated proxies need neither.
- Agent uses `spring.http.client.*` - global defaults are under `spring.http.clients.*`; group settings use `serviceclient`.
- Agent hard-codes a host in `@HttpExchange` and sets a group base URL - keep the host in configuration.
- Agent returns `Mono` or `Flux` with the default client - select `WEB_CLIENT` explicitly.
- Agent assumes a group configurer customizes one interface - configure the group or separate the group.
Files in this package (4)
- SKILL.md 2 KB
- agents/openai.yaml 1 KB
- examples/bad-order-client.java 1 KB
- examples/good-order-client.java 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · rrezartprebreza/spring-boot-skills | 100 | MIT |
| rrezartprebreza/spring-boot-skills | 100 | MIT |
Database snapshot: 13.11.2026 · package version db80c8034e9d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100spring-testing-http-client
Test outbound HTTP client code in Spring Boot apps - RestClient, HTTP interface clients (@HttpExchange), RestTemplate - with MockRestServiceServer, @RestClientTest, or a stub HTTP server. Use when testing code that calls a third-party or remote API: the request it sends, how it… - 100spring-cloud-openfeign
Declarative HTTP client for microservices communication with Spring Cloud OpenFeign. Covers @FeignClient, error handling, interceptors, and circuit breaker integration. USE WHEN: user mentions "feign", "openfeign", "@FeignClient", "declarative HTTP client", "service-to-service… - 100spring-web
Spring Web MVC advanced for Spring Boot 3.x. Covers RestClient (Spring 6.1+), WebClient, ResponseEntity patterns, interceptors, content negotiation, file upload/download, streaming responses, and custom argument resolvers. USE WHEN: user mentions "spring web", "RestClient",… - 100spring-boot-web-api
Spring Boot 4 REST API implementation patterns. Use when creating REST controllers, REST endpoints, request validation, exception handlers with ProblemDetail (RFC 9457), API versioning, content negotiation, WebFlux reactive endpoints, HTTP clients with @HttpExchange, JSON… - 95restclient-migration
Migrate RestTemplate to RestClient in Spring Boot 3.2+. Use when replacing deprecated RestTemplate with modern fluent API, updating HTTP client code, or configuring RestClient beans. Covers GET/POST/DELETE migrations, error handling, and ParameterizedTypeReference usage. - 100spring-boot-expert
Expert-level Spring Boot, Spring Framework, REST APIs, and microservices development. Use when the user mentions Java, Spring framework, REST APIs, or microservices, or when the task involves Spring Boot Fundamentals.