2017-05-25 91 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。

相關問題