The best way to understand how Twilio Functions works is to start by understanding the HTTP request flow and how Twilio ultimately executes your code. Twilio Functions is designed to handle as much of the infrastructure work of building a web app as possible so that you can focus on application logic instead. For Twilio Functions, this work begins at the front door, handling the HTTP request for your Function and continues through the pipeline up to your code.
. Once the payload has been constructed, it is used to invoke your Function.
code that you have provided. When your Function completes executing, it can emit a response using the
method. The emitted response will be transmitted to the Function Gateway.
Currently, Twilio Functions only supports HTTP requests. Twilio Functions will respond to three HTTP verbs:
DELETE are currently not supported.
POST requests, Twilio Functions natively supports the
application/x-www-form-urlencoded content types. This means that JSON bodies and form and query parameters will be normalized into the event parameter.
There are several important limitations to Twilio Functions that you should consider when designing your application:
HTTP 504 Gateway Time-out
Now that you have an understanding of the request flow to your Functions, it's time to learn about the execution process, handler method, and response building processes.