pfx-rest Component

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 rest-oauth2 connection type

Basic-auth protected endpoint

Yes

Use rest-basic connection type

Public / no-auth API

Yes

Use rest-public connection type

JWT token-based auth

Yes

Use rest-jwt connection type

Download large files from REST endpoint

Yes

Enable disableStreamCache=true

Call Pricefx partition APIs

No

Use pfx-api component instead

Send emails

No

Use pfx-email component instead

Quick Start

XML
<route id="restGet">
    <from uri="direct:fetchData"/>
    <to uri="pfx-rest:get?connection=myRestConn&amp;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

get

HTTP GET

post

HTTP POST

put

HTTP PUT

delete

HTTP DELETE

patch

HTTP PATCH

head

HTTP HEAD

options

HTTP OPTIONS

trace

HTTP TRACE

system

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