Hello all. Following the documentation on Serverless Functions, it is demonstrated how to pass over input arguments into the function handler (the ‘args’ for the ‘main()’ function. It is shown and explained that the parameters can be passed as query strings (i.e. GET method) and retrieved in the handler using the ‘args’ object. Is there a way to also pass such input parameters using POST? For instance, listening to PayPal webhook require POST acceptance. Also, passing over a large base64 input (image/audio) does not make sense as a GET parameter. How can these be accepted and retrieved within the main(args) handler, both for a web function as well as internal call. Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey!
Yes, that should be doable as described here:
web: true
: This is the default mode. Query string parameters and the request body are parsed and added as top-level keys in theevent
dictionary.web: raw
: The HTTP request body and query string are included as-is instead of being parsed.web: false
: No web event is included at all.The default
web: true
event is structured like the following JSON example:Let me know how it goes!
Best,
Bobby