Call API in React Js | How to send data from frontend to backend react
HTML-код
- Опубликовано: 7 фев 2022
- In this tutorial, I show you how to call API in react js. If you want to send or receive some data from the backend and you don't know how to send data from frontend to backend react, this quick video can help you how to achieve this.
You can download the project source code from here: pezeshkzade.com/blog/source-c...
Fetch docs: developer.mozilla.org/en-US/d...
Hope you enjoy it.
Consider subscribing...
Have a great day. - Наука
You can download the project source code from here: pezeshkzade.com/blog/source-code/
Bro your good mentor. Explanation was so good. Thank you bro✊✊✊
Thank you, excellent guide by API with clear explanation for every step
Thanks, that was really helpful.
Bro Masoud you are a star like you explained this like you are explaining it to a baby.
hey man great tutorial! i'm trying to send a word from search bar to backend into a function... which fetches data from API and updates it into the backend server..how can i do something like that? 1. search 2. use the search to fetch data from API 3. update the backend server with new data 4. display new data to front end
very clear explanation
سلام ،من یه با react یه برنامه نوشتم الان میخوام با axios وصل کنم به backend ولی من چیزی از backend نمیدونم فقط میخوام بزارم روی رزومه ام که بدونن کار با axios رو بلدم ، میخوام یه سری دیتا مثل Id و taskName رو از backend بگیرم باید چی کار کنم ؟
Great very helpful for me
how can I make my local data in a localhost data please?
nice you solved my doubt
When you setAuthors in line 35 after creating a author, why do you use an => instead of just setAuthors([…prev, resultInJson])
because when our state depends on old value of state, we use arrow function...in this case, we had to pick other 4 users as well, so we used the spread operator to get them as well and then added the new user.
Hi, tanks for the video.. i have a problem in my code.
Uncaught (in promise) SyntaxError: Unexpected end of input (at Main.jsx:17:1)
That line contains:
const resultJson = await result.json()
good video
Masound can i contact you privately?
👏🏼
Whem posting data to server I'm receiving "has been blocked by CORS policy" error, how can I solve this ? thanks so much, very good tutorial
Because your server domain address and your client address(localhost) doesn't match.
You need to add the dependency cors to connect the backend to the front-end. Add npm install cors command to your back-end json package in the terminal. And you most definitely want your backend port different from your front-end port.