0
我正在使用WSO2 esb 4.8.0並試圖對PayPal API OAuth請求(request with title OAuth Request/Response)進行REST調用。請求的內容類型需要爲application/x-www-form-urlencoded
。我試圖用幾種方法來做到這一點。發送帶有應用程序/ x-www-form-urlencoded編碼的表單數據,內部有效負載
(for better code view please refer this)
<payloadFactory media-type="json"> <format> { "grant_type":"client_credentials" } </format>
</payloadFactory>
<property name="messageType" value="application/x-www-form-urlencoded" scope="axis2"/>
<call> <endpoint> <http method="post" uri-template="https://api.sandbox.paypal.com/v1/oauth2/token?grant_type=client_credentials"/> <property name="grant_type" value="client_credentials"/> </endpoint> </call>
是的,我已經包括了3種可能(似乎是可能的)在一次代碼的方式(並試圖爲好)撥打這通電話。但是帖子參數沒有正確傳遞到結束點。我使用HTTP/1.1 400代碼獲得以下響應。
{"error":"invalid_request","error_description":"grant_type is a required parameter"}
感謝有人能幫助我解決這個問題。