This connection is tied with basic authentication. You can define custom headers and values.
Properties
|
Option |
Type |
Default |
Description |
|---|---|---|---|
|
|
string |
|
ID of the connection. |
|
|
string |
|
Base URL of the connection. A full path must be provided (e.g.: https://...). |
|
|
java.util.Map |
|
Custom headers. |
|
|
string |
|
Name of the certificate. |
|
|
string |
Basic |
Prefix of the value in auth header. For example: Basic zxz13ss. |
|
|
string |
Authorization |
Header name of the auth header. |
|
|
string |
|
Username for basic authentication. |
|
|
string |
|
Password for basic authentication. |
Examples
Define a new connection:
<bean id="basicConn" class="net.pricefx.integration.component.rest.domain.connection.BasicConnection">
<property name="url" value="https://thecompany.com"/>
<property name="authRequestHeaderBearer" value="Pricefx"/>
<property name="authRequestHeader" value="PartitionX"/>
<property name="username" value="pasta"/>
<property name="password" value="rasta"/>
</bean>
Use it in a route:
<route id="opendata2-create">
<from uri="direct:create"/>
<to uri="pfx-rest:post?uri=/A_SalesOrder&connection=basicConn"/>
<to uri="mock:create"/>
</route>
Results:
-
Request to https://thecompany.com/A_SalesOrder was done with the header
PartitionXand valuePricefx xxx(xxx is a hash of username/password). -
Data are returned.