如何在apache camel中为ahc组件设置授权头?我总是使用org.springframework.web.client.HttpClientErrorException:401 Authorization Required错误。以下是我的示例代码:
public class Oval:Shape
{
//Constructor
public Oval(double majorAxis, double minorAxis)
{
MajorAxis=majorAxis;
MinorAxis=minorAxis;
}
protected double MajorAxis{ get; set; }
protected double MinorAxis{ get; set; }
}
public class Circle:Oval
{
//Constructor
public Circle(double radius): base(radius,radius)
{
radius = Circle_Radius;
} //constructor
public double Radius
{
get
{
return MajorAxis;
}
set
{
MajorAxis = value;
MinorAxis = value;
}
}
}
答案 0 :(得分:0)
尝试使用simple
作为标题
<setHeader headerName="Authorization">
<simple>Basic eWFtYW4pLm5haXJAbWF5bGFiLm19OnlhbWvbgFGH=</simple>
</setHeader>