如何在Anypoint Studio中配置"HTTP_request_configuration"?

How to configure "HTTP_request_configuration" in Anypoint Studio?

我正在使用 Anypoint 6.2.3,我正在尝试调用 api baconipsum.com/api/?type= meat-and-filler 为此,我的项目流程是

<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="9000" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="baconipsum.com"  doc:name="HTTP Request Configuration" basePath="api" port="8081"/>
<flow name="test2Flow1" >
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP" >
      <http:request-builder>
            <http:query-param paramName="type" value="#[message.inboundProperties.'http.query.params'.type]"/>
            <http:query-param paramName="sentences" value="#[message.inboundProperties.'http.query.params'.sentences]"/>
        </http:request-builder>
    </http:request>
  <file:outbound-endpoint path="C:/Users/arpit_jain2/Desktop/Response" outputPattern="res.json" responseTimeout="10000" doc:name="File"/>
</flow>

而 HTTP_Request_Configuration 是

HTTP_Request_Configuration

在 MuleSoft 的文档中,没有分配端口号并且它工作正常但是当我实现相同的配置时我得到了错误。

必须提供端口值

有谁知道端口应该是什么以及为什么我收到空负载错误。

Error while calling the API
我在 Anypoint 配置或 HTTP_Request_Configuraion 中遗漏了什么吗?

http 的默认端口是 80。因此请设置 port="80"

您已设置为 8081,http://baconipsum.com/api/?type=meat-and-filler 正在侦听 80(默认)而非 8081

您可以尝试以下两个更改。
1.Change 您的 basePath="api"basePath="/api" 并尝试。并且
2.Try 没有像你提到的那样添加任何端口 baconipsum.com/api/?type=meat-and-filler.

如果您仍然遇到问题,那么 post 您得到的完整错误详细信息。

请在您的 HTTP 请求配置中设置端口 = 80。