How to troubleshoot in case of a call failure?
See Gateway exception troubleshooting.
What are the meanings of the result codes returned by APIs?
See Gateway result codes.
When OkHttp is referrenced, how to deal with the conflict between OKio and mPaaS?
To solve the conflict, perform the following steps:
- Comment out the wire component of mPaaS.
mpaascomponents{
excludeDependencies=['com.alipay.android.phone.thirdparty:wire-build']
}
- Use the wire component provided on the Internet.
implementation 'com.squareup.wire:wire-lite-runtime:1.5.3.4@jar'
How to put parameters in POST body when sending a POST request by calling the MGS RPC interface through JSAPI?
First, you must correctly configure the POST body and corresponding data model for MGS. When sending a request through JSAPI, you need to take the POST body as the value of _requestBody
and put it in the requestData
parameter, as shown in the following sample:
window.onload = function() {
ready(function() {
window.AlipayJSBridge.call('rpc', {
operationType: 'MYAPI',
requestData: [
{"_requestBody":"{\"key1\":\"value1\",\"key2\":\"value2\"}"}],
headers:{},
getResponse: true
}, function(data) {
alert(JSON.stringify(data));
});
});
}