0% found this document useful (0 votes)
21 views15 pages

Day23 ReactJS ServerCalls Slides

Uploaded by

Warstilide49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views15 pages

Day23 ReactJS ServerCalls Slides

Uploaded by

Warstilide49
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Narasimha

Sr. Corporate Trainer, Mentor


Narasimha
Sr. Corporate Trainer, Mentor
Week5 – React JS
Day21 : Introduction, Components
Day22 : State, Events, Apply Styles
Day23 : Remote Server Calls, Form Validations
Day24 : Routing and Redux, React Hooks
Day25 : Testing
Narasimha
Sr. IT Trainer/Consultant
Narasimha
Sr. IT Trainer/Consultant
Server Calls - AJAX

• AJAX is client side programming technique to exchange


data between client and server
• We can implement AJAX calls in React in the following
ways:
– window.fetch() method
– axios library
Axios Package

• Axios is a lightweight HTTP client based library


• It helps us to communicate with server.

• Installation:
• npm install --save axios
JSON Server

.NET
Oracle
React JSON Java
MySql
PHP
APP Python Sql Server
Node / Express MongoDb

Client Server Database


Axios Package - Usage

import axios from 'axios';


axios.get(url).then(resData =>
{
// process the resData
});
Axios Methods for CRUD

CREATE : axios.get(url).then();
READ : axios.post(url, data).then();
UPDATE : axios.put(url, data).then();
DELETE : axios.delete(url).then();
Hands-On Implementation
Practice Hands-Ons

You might also like