ADS_PSI
8 years agoMentor
Create a endpoint which is of POST type
Hi,
Normally when we create endpoint and expose it to third party it is of method GET. Can we create endpoint for POST type ?
I think you might be able to restrict to POST only with the FreeMarker http.request context object (only available in page init script and endpoints), e.g. something like this as a wrapper of your endpoint code:
<#if http.request.method == "POST"> // execute your POST only code here <#else> // was another request method than POST, return error or whatever is suitable </#if>
see here for more info: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=freemarker#l::{"p":"%2Frefer%2FcontextObjects","h":"%23httpRequest"}