Skip to content
Back to skills

Http Interface Clients

ASecurity

Use when calling external HTTP APIs from Spring Boot 3 / Spring Framework 6 with declarative HttpExchange interfaces. Covers manual proxy registration, RestClient versus WebClient, and timeout and error handling conventions.

  • 272 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 1, 2026
ai-agentsgojavareactspringapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Http Interface Clients?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Http Interface Clients
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rrezartprebreza-http-interface-clients/badge)](https://www.skillsdirectory.com/skills/rrezartprebreza-http-interface-clients)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: http-interface-clients
description: >
  Use when calling external HTTP APIs from Spring Boot 3 / Spring Framework 6 with declarative
  HttpExchange interfaces. Covers manual proxy registration, RestClient versus WebClient, and
  timeout and error handling conventions.
---

# Declarative HTTP Interface Clients (Boot 3)

Spring Framework 6 supports `@HttpExchange` interfaces, but Boot 3 does not provide Boot 4's
`@ImportHttpServices` group auto-registration. Build the client adapter explicitly.

```java
@HttpExchange("/orders")
interface OrderApiClient {
    @GetExchange("/{id}")
    OrderDto get(@PathVariable UUID id);
}

@Configuration
class ClientConfig {
    @Bean
    OrderApiClient orderApiClient(RestClient.Builder builder,
                                  @Value("${clients.orders.base-url}") String baseUrl) {
        RestClient client = builder.baseUrl(baseUrl).build();
        HttpServiceProxyFactory factory =
            HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
        return factory.createClient(OrderApiClient.class);
    }
}
```

Use `WebClientAdapter` for reactive interfaces returning `Mono` or `Flux`. Configure base URLs,
timeouts, authentication, and error translation in the client adapter layer rather than in
controllers or domain services. Prefer one factory/configurer per external service.

## Gotchas

- Agent uses `@ImportHttpServices` - that Boot 4 registration API is not available in Boot 3.
- Agent adds `@Component` or an implementation to the interface - register the generated proxy as a bean.
- Agent uses `RestClient` for `Mono` or `Flux` - use `WebClientAdapter` for reactive return types.
- Agent hard-codes remote hosts in annotations - keep URLs in configuration.
- Agent lets transport errors leak through the domain - translate them in the client adapter.
- Agent creates a new client per request - configure and reuse a singleton proxy.

Files in this skill

  • SKILL.md1.9 KB
  • agents/openai.yaml204 B
  • examples/bad-order-client.java148 B
  • examples/good-order-client.java197 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.