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 the data is limited to 6Mb. OAuth, which is configured in is only processed in the remote REST service. Remote REST function calls are helpful when:
- OAuth needs to secure.
- The calling IP addresses on the third-party service need to be allowlisted.
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 third-party REST service is the only limit to data size when using a local REST function. Local REST function calls are useful when:
- There is a requirement not to 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
- Only OAuth authentication can be used with local REST calls.
- When useLocalCall: true is set, functions that rely on secrets or other authentication mechanisms not available locally will not execute.
Adding the useLocalCall: true property to a REST function directs the function call to use local execution. Leaving the property out of the definition or setting it to useLocalCall: false directs the function call to use remote execution.
For examples using Remote REST functions, see REST Authentication.