You need to sign in to do that
Don't have an account?
inbox outbox 7
Difference between fetch API and its method fetch() and directly making a callout from the apex controller in LWC?
We can make a callout by adding CSP site, and use fetch() in the js file.
We can also make a HTTP request from the apex controller.
I can only think of one thing:
If we are just making a GET request to show some data on LWC, we use fetch api.
If we are doing a process integration, where the response has to updated in to the salesforce and the component has to be re-rendered we use apex controller class. Is that right?
Can someone explain the difference?
We can also make a HTTP request from the apex controller.
I can only think of one thing:
If we are just making a GET request to show some data on LWC, we use fetch api.
If we are doing a process integration, where the response has to updated in to the salesforce and the component has to be re-rendered we use apex controller class. Is that right?
Can someone explain the difference?
Example:
https://blog.salesforcecasts.com/using-fetch-api-in-lwc/
Please mark as Best Answer if above information was helpful.
Thanks,