我是Mulesoft的新手,並試圖發送一些(四個)查詢參數。 「:」 INVALID_REQUEST 「 」ERROR_DESCRIPTION當使用SOAP UI A screen shot of what I tested如何將查詢字符串傳遞給使用mulesoft的發佈請求
測試我使用下面的XML配置
<flow name="boxintegrationFlow1">
<http:listener config-ref="HTTP_Listener_Configuration1" path="*" doc:name="HTTP"/>
<logger message="Message: #[message.inboundProperties] Code: #[message.inboundProperties.'http.query.params'.code]" level="INFO" doc:name="Logger"/>
<set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" doc:name="Property"/>
<set-variable variableName="QueryParameters" value="{'grant_type':'authorization_code', 'code':''#[message.inboundProperties.'http.query.params'.code]','client_id':'abc','client_secret':'xyz'}" doc:name="Variable" mimeType="application/x-www-form-urlencoded"/>
<logger message="#[flowVars.QueryParameters]" level="INFO" doc:name="Logger"/>
<set-payload value="#[flowVars.QueryParameters]" doc:name="PostQueryParameters"/>
<http:request config-ref="getToken" path="/oauth2/token" method="POST" sendBodyMode="ALWAYS" doc:name="HTTP">
<http:request-builder>
<http:query-param paramName="grant_type" value="authorization_code"/>
<http:query-param paramName="code" value="#[message.inboundProperties.'http.query.params'.code]"/>
<http:query-param paramName="client_id" value="xyz"/>
<http:query-param paramName="client_secret" value="abc"/>
</http:request-builder>
<http:success-status-code-validator values="400"/>
</http:request>
<logger message="Message: #[message.outboundProperties] " level="INFO" doc:name="Logger"/>
</flow>
在這樣做我得到一個錯誤 「{」 錯誤重複這mulesoft「:」無效的grant_type參數或參數缺失「}」
我明白我們已經將它作爲查詢字符串傳遞,但我無法弄清楚我該如何做。
任何指針表示讚賞。先謝謝你!
其工作正常,當我測試它。在那裏發送它作爲查詢參數。 –
您還在查詢字符串和帖子正文中設置參數。你應該只在一個地方做。我知道騾OAuth提供商會給你一個錯誤,如果你把它放在兩個地方。刪除身體,只使用查詢字符串,反之亦然。這可能是你的問題。 – Charles
感謝您的快速回復..建議我嘗試刪除它們在一個地方。 –