HTTP API request format

更新时间:
复制 MD 格式

The Mobile RPC (MRPC) protocol is an HTTP-based protocol for communication between an mPaaS client and the mobile gateway. When calling an API from the API test page or from a non-mPaaS client such as Postman, construct the request in the format described on this page.

API test page

On the API test page, set the request parameter to [{}]. The body content format depends on the backend HTTP service type:

  • For a get backend service: place query parameters directly inside [{}].

  • For a post backend service: use the _requestBody key to pass body parameters, for example, [{"_requestBody":"<your-request-body>"}].

Non-mPaaS clients

Important

Before sending any request from a non-mPaaS client such as Postman, disable Signature Verification and Data Encryption on the Gateway Management page of the mobile gateway console. Requests sent without disabling these settings will fail.

Use the following format for the request body. The parameters in the red box in the figure below are fixed — replace all other parameters with your actual API values.

Set the Body parameter to [{}]. The format depends on the backend HTTP service type:

  • For a get backend service: place query parameters directly inside [{}].

  • For a post backend service: pass body parameters as the value of the _requestBody key.

If the backend HTTP service uses the get method, do not change the post method in the client request. Instead, go to API Details > Basic Information in the mobile gateway console and set the invocation method to get.