2017-05-25 93 views
0

我使用Anypoint 6.2.3,我试图调用的API baconipsum.com/api/?type=meat-and-filler的是,我的项目流程是如何在Anypoint Studio中配置“HTTP_request_configuration”?

<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

回答

-1

这里有两个变化,你可以试试。
1.将您的basePath =“api”更改为basePath =“/ api”并尝试使用。和
2.尝试不添加任何端口,因为您提到baconipsum.com/api/?type=meat-and-filler

如果仍然遇到问题,请发布完整的错误详细信息。

0

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

相关问题