Platform version 2.3 : Request method with request templates [Now in beta]

We are excited to announce our security-enhanced Request method to send HTTP requests by using a request template - now in beta!

What’s new?

  • A new configuration file to add HTTP request configurations/templates - config/requests.json.
  • A new property in app manifest, for each product, to explicitly describe which templates defined in the configuration file is used in the app code - requests.
  • A new runtime API to work with request templates - client.request.invokeTemplate() (for front-end) and $request.invokeTemplate() (for serverless).
  • Deprecation of whitelisted-domains property from app manifest as the request template explicitly declares the host.

These features are available through Platform version 2.3 and FDK version 9.0.0.

Before you install the FDK v9, ensure to:

Remove the FDK directory.

rm -rf ~/.fdk

Uninstall FDK v8.

npm rm fdk -g

Install FDK v9 globally.

npm install https://cdn.freshdev.io/assets/cli/fdk.tgz -g

For sample apps with request templates, see request-method-samples.

For information on how to migrate to platform 2.3 and build apps that use the Request method, take a look at the Request method user guide.
UserGuide.pdf (140.1 KB)

9 Likes

When will you publish it through npmjs.org with proper versioning?

1 Like

We have small doubts about consuming the Request Template in the iparams.html value. If we are required to call API Request in iparams.html with subdomain & API Key(Iparams value but the app not installed yet), it should be passed as context. Could you please confirm the same?

Hi @juliankleine,
At the moment, we haven’t published it on NPM.

Hi @ajithr,
Yes, the context-based substitution is allowed for requests in iparams.html.

Hi @zach_jones_noel
I know - Are there any plans to do so? If not what is the reason behind this?

1 Like

I went through the UserGuide and didn’t find anything related to caching of requests. It was available in the earlier client.request.get method. But, doesn’t seem to feature in the invokeTemplate. Is there a way to cache the requests in the new invocation?

1 Like

Hey @arunrajkumar235,

Yes it is possible with client.request.invokeTemplate('templateName', { cache: true })

Thanks for pointing this out, we will update the document also very soon.

2 Likes

This topic was automatically closed after 60 days. New replies are no longer allowed.