如何在apache camel中设置授权头:ahc

时间:2016-08-04 06:21:36

标签: spring apache-camel

如何在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;
        }

    }
}

1 个答案:

答案 0 :(得分:0)

尝试使用simple作为标题

<setHeader headerName="Authorization">
    <simple>Basic eWFtYW4pLm5haXJAbWF5bGFiLm19OnlhbWvbgFGH=</simple>
</setHeader>