Tagrest api

REST APIs in React: Axios vs Fetch API

R

Introduction APIs generally charge our applications with data. The client-side of the application consumes data from API which is normally in JSON format and is with specified endpoints. This information will look into the two ways, an application can consume an API. These ways are through ‘Fetch’ API which is a browser built-in API used to make the necessary HTTP requests and the Axios API which...

Rest API Call for GET and POST

R

@RestResource(urlMapping=’/Account/*’) global with sharing class MyRestResource { @HttpGet global static Account doGet() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; String accountId = req.requestURI.substring(req.requestURI.lastIndexOf(‘/’)+1); Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];...

Category