Handling different HTTP methods in Oracle Fn

July 27, 2020 | 2 minute read
Derek Kam
Consulting Solutions Architect
Text Size 100%:

In this blog, I will demonstrate how to handle different HTTP verbs (POST, GET, DELETE, and PATCH) in Oracle Fn. I will use Java and NodeJS to demonstrate.

In FnProject, if you are using the default mechanism "invoke" to call your function, it will be using the HTTP post method, so if you want to call your functions with other HTTP methods like HTTP get or other HTTP PUT, etc, you need to use the trigger function in Fn, as the trigger function support all HTTP verbs. However, Oracle Fn doesn’t support the trigger function.

To handle all HTTP verbs in Oracle Fn, you can add HTTPGatewayContext as one of the parameters to your function. If you want to access the payload in the request body in Java, you can add InputEvent to your function parameter.

To test the code you need to configure the API Gateway to accept the HTTP verbs you require. See here for more details on how to configure a function as an API Gateway backend, after that you can test your function using curl, e.g. curl -X GET  https://<API Gateway URL>

Java Function Sample:

Nodejs  Function Sample:

Derek Kam

Consulting Solutions Architect

Derek Kam is a Consulting Solutions Architect in the A-Team at Oracle Corporation. He works closely with customers and partners, worldwide, providing guidance on architecture, best practices, troubleshooting and how best to use Oracle Cloud Services and products to solve customer business needs. Derek is a multi-skilled IT professional with more than 26 years of experience, possessing a wide range of experience and expertise in the Oracle Fusion Middleware and Oracle Clouds (PaaS and IaaS) technical and architecture design, development, software testing and quality assurance, and project management. Prior to joining Oracle in 2012, Derek has worked in consulting, financial and retail industries.


Previous Post

Setting Up ODI Marketplace Agents in High Availability with ATP

Matthieu Lombard | 9 min read

Next Post


Provisioning Oracle Analytics Cloud with a Private End-Point

Dayne Carley | 1 min read