Este conteúdo não está disponível no idioma selecionado.
Chapter 65. Rest
Expose REST services and their OpenAPI Specification or call external REST services.
65.1. What’s inside Copiar o linkLink copiado para a área de transferência!
-
REST component, URI syntax:
rest:method:path:uriTemplate
-
REST API component, URI syntax:
rest-api:path
Please refer to the above links for usage and configuration details.
65.2. Maven coordinates Copiar o linkLink copiado para a área de transferência!
Create a new project with this extension on code.quarkus.redhat.com
Or add the coordinates to your existing project:
<dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-rest</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-rest</artifactId>
</dependency>
65.3. Additional Camel Quarkus configuration Copiar o linkLink copiado para a área de transferência!
This extension depends on the Platform HTTP extension and configures it as the component that provides the REST transport.
65.3.1. Path parameters containing special characters with platform-http Copiar o linkLink copiado para a área de transferência!
When using the platform-http
REST transport, some characters are not allowed within path parameter names. This includes the '-' and '$' characters.
In order to make the below example REST /dashed/param
route work correctly, a system property is required io.vertx.web.route.param.extended-pattern=true
.
There is some more background to this in the Vert.x Web documentation.
65.3.2. Configuring alternate REST transport providers Copiar o linkLink copiado para a área de transferência!
To use another REST transport provider, such as netty-http
or servlet
, you need to add the respective extension as a dependency to your project and set the provider in your RouteBuilder
. E.g. for servlet
, you’d have to add the org.apache.camel.quarkus:camel-quarkus-servlet
dependency and the set the provider as follows: