如何为https请求定义camel jetty路由并将参数传递给一些api进行身份验证?

How to define camel jetty routes for https request and pass the parameter to some api for authentication?

我想使用 camel-jetty 组件发送 https 消费者请求,该地址 returns 一些 JSON 格式的响应,下面我提到了我的 DSL 代码。

from("jetty:https://someSiteAddress.com/api/control/authorizeUser?username=__&password=__").to("stream:out"); 

I am getting this warning:  
[WARNING]   
java.net.SocketException: Permission denied  
at sun.nio.ch.Net.bind0 (Native Method)  
at sun.nio.ch.Net.bind (Net.java:433)
at sun.nio.ch.Net.bind (Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind 

但每当我在浏览器中点击此 HTTP URL 时,它都会通过身份验证完美执行。
如果有人知道如何在 apache camel 中执行此操作,请帮助我,这对我和其他人来说都会非常愉快。

我怎么知道 camel 使用哪种方法发送 POST 或 GET 等请求。
谢谢

你能试试这个吗?我会评论每一行以帮助理解您的问题。

// endpoint to start your route. could be a http endpoint you expose via jetty, jms, vm, seda or any other option. Here I'm using the simplest one.
from("direct:start")
    // logs on
    .to("log:DEBUG?showBody=true&showHeaders=true")
    // consume the endpoint
    .to("https://someSiteAddress.com/api/control/authorizeUser?username=__&password=__"")
    // log the body to the console so you could process the response later knowing what to do (the token you are mentioning should be in here.
    .to("log:DEBUG?showBody=true&showHeaders=true")
    .to("stream:out") //or whatever you want to

不要忘记 camel-http 这个例子的依赖性:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-http</artifactId>
</dependency>

干杯!

这也很好用。

  from("direct:in")
 .to("https://www.someAddress.com/api/control /authorizeUser?username=__ &password=__")
 .to("stream:out");

感谢@RicardoZanini