Annotation Interface Client
Allows defining declarative HTTP clients and customizing injection for injecting
HttpClient
implementations.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe protocols to support for TLS ALPN.Class<? extends HttpClientConfiguration>
Class<?>
Deprecated.There are now separate settings for HTTP and HTTPS connections.The base URI for the client.The connection mode to use for plaintext (http as opposed to https) connections.
-
Element Details
-
value
- Returns:
- The URL or service ID of the remote service
- Default:
- ""
-
id
- Returns:
- The ID of the client
- Default:
- ""
-
path
String pathThe base URI for the client. Only to be used in conjunction withid()
.- Returns:
- The base URI
- Default:
- ""
-
errorType
Class<?> errorType- Returns:
- The type used to decode errors
- Default:
- io.micronaut.http.hateoas.JsonError.class
-
configuration
Class<? extends HttpClientConfiguration> configuration- Returns:
- The http client configuration bean to use
- Default:
- io.micronaut.http.client.HttpClientConfiguration.class
-
httpVersion
Deprecated.There are now separate settings for HTTP and HTTPS connections. To configure HTTP connections (e.g. for h2c), useplaintextMode()
. To configure ALPN, setalpnModes()
.The HTTP version.- Returns:
- The HTTP version of the client.
- Default:
- HTTP_1_1
-
plaintextMode
The connection mode to use for plaintext (http as opposed to https) connections.
Note: IfhttpVersion()
is set, this setting is ignored!- Returns:
- The plaintext connection mode.
- Since:
- 4.0.0
- Default:
- HTTP_1
-
alpnModes
The protocols to support for TLS ALPN. If HTTP 2 is included, this will also restrict the TLS cipher suites to those supported by the HTTP 2 standard.
Note: IfhttpVersion()
is set, this setting is ignored!- Returns:
- The supported ALPN protocols.
- Since:
- 4.0.0
- Default:
- {"h2", "http/1.1"}
-