Post method:
instancename.post(API url,object,{
headers:request headers}).then(response=>{
//posting the necessary data to do something here
}).catch(error=>console.error('error faced',error));
Get method:
instancename.get('${API url}/${thing you want}',{
headers: request headers}).then(response=>{
//code you want to do with response
}).catch(error=>console.error('error message',error))
PUT method:
instancename.put('${API url}/${thing you want}',object,{headers:request headers}).then(response=>{
//code action you want to perform
}).catch(error=>console.error('PUT request error',error))
Delete method:
instance.delete('${API URL}/${thing you want}',{
headers:request headers}).then(response=>{
//something here
}).catch(error=>console.error('Delete error',error))
These are just a basic syntax of how to implement them. i would recommend you to experiment and maybe you can make some tweaks to them.
Enroll in our web development course to become an expert in Web Development!