pfx-rest Component
Summary: Reference for the pfx-rest Camel component — HTTP REST calls to external APIs with connection/authentication support.
Overview
The pfx-rest component is a producer-only Camel component for making HTTP requests to external APIs. It supports all standard HTTP methods, multiple authentication strategies (Basic, OAuth2, JWT, public/no-auth), named connections, proxy configuration, response size limits, streaming, and connection pooling.
The component is registered under the scheme pfx-rest and belongs to the API category.
URI Format
pfx-rest:method[?options]
The method path parameter is required and determines the HTTP method used. It also supports a special system method for system-configuration-based requests.
When to Use
|
Scenario |
Use pfx-rest? |
Notes |
|---|---|---|
|
Call an external REST API (e.g., SAP, Salesforce) |
Yes |
Use a named connection for auth |
|
OAuth2 client-credentials flow |
Yes |
Use |
|
Basic-auth protected endpoint |
Yes |
Use |
|
Public / no-auth API |
Yes |
Use |
|
JWT token-based auth |
Yes |
Use |
|
Download large files from REST endpoint |
Yes |
Enable |
|
Call Pricefx partition APIs |
No |
Use |
|
Send emails |
No |
Use |
Quick Start
<route id="restGet">
<from uri="direct:fetchData"/>
<to uri="pfx-rest:get?connection=myRestConn&uri=/api/v1/products"/>
</route>
This route performs an HTTP GET to /api/v1/products using the named connection myRestConn for base URL and authentication.
Supported HTTP Methods
|
Method |
Description |
|---|---|
|
|
HTTP GET |
|
|
HTTP POST |
|
|
HTTP PUT |
|
|
HTTP DELETE |
|
|
HTTP PATCH |
|
|
HTTP HEAD |
|
|
HTTP OPTIONS |
|
|
HTTP TRACE |
|
|
Special method that reads configuration from system properties rather than inline parameters |
For full details on each method with examples, and the complete list of URI parameters, see the Methods subpage.
See Also
-
Connections Concept — managing REST connection types (public, basic, JWT, OAuth2), authentication templates, re-authentication, and SSL certificates
-
Methods — all HTTP methods with examples, and the complete URI parameter reference (core, input/output, proxy, timeouts, connection pooling, streaming)
-
Routes — route configuration
-
Mappers — request/response mapping
-
Filters — filtering