SpreadAPI has to deal with limitations imposed by the Google Apps Script engine. There are two limitations that make running a state-of-art REST API impossible in this environment:
Each script can respond only on one hardcoded URL. It can't handle request comming at subpaths like /users or /transactions/15.
Only GET and POST methods are supported.
Due to the these limitations the SpreadAPI script handles only POST requests on a single URL. The actual HTTP method and resource path are provided in request body as shown in the example below:
Other parameters (like payload for POST and PUT requests) are provided as additional fields in the request body:
For more information on this topic visit API Reference documentation page.
Usage in browsers
SpreadAPI can be used as a back-end service for your web applications. To successfully call the API you need to set Content-Type HTTP header to application/x-www-form-urlencoded . If you fail to do that your request will be blocked by CORS. Keep in mind that request payload should still be JSON despite the Content-Type header.
The example below shows how to successfully call SpreadAPI using jQuery and axios.