Local REST Calls
The REST provider populates list data or performs other REST methods using a third-party REST service.
By default, a REST function will split processing between the mobile app (local) and the REST service (remote). The mobile app wraps the REST call and sends it to the remote REST function that in turn calls the third-party service. Results are returned to the mobile app from the third-party REST service via the remote REST function. When using the remote REST service the size of data is limited to 6Mb. Secrets, such as API keys, which are configured in is only processed in the remote REST service. Remote REST function calls are useful when:
- Secrets (such as API keys) need to secure
- The calling IP addresses on the third-party service need to be whitelisted
For examples using Remote REST functions see REST Authentication.
A local REST function call allows the mobile app to perform all the processing locally and call the third-party service directly. As a result, data is only transferred between the mobile app and the third-party REST service. The only limit to data size when using a local REST function is the third-party REST service. Local REST function calls are useful when:
- There is a requirement to not send any data through the AWS infrastructure
- The third-party REST service has a limit larger than 6Mb on the amount of data that can be transferred
Adding the useLocalCall: true property to a REST function will direct the function call to use local execution. Leaving the property out of the definition or setting it to useLocalCall: false will direct the function call to use remote execution.