Это видео недоступно.
Сожалеем об этом.
Axios API for JavaScript: GET, POST, PUT and DELETE requests
HTML-код
- Опубликовано: 1 май 2022
- 👉 Source code: openjavascript...
⚡ Looking for high-performance, affordable web hosting for your website or app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
This tutorial shows you how to make HTTP requests (GET, POST, PUT and DELETE) using the Axios API in frontend, vanilla JavaScript.
#axios #javascript #vanillajs #httprequest #frontend #webdevelopment #api
🔔 Subscribe for more tutorials just like this: / @openjavascript
⚡ NEW: Web development courses from Meta Inc. ⚡
Front-End Developer Professional Certificate: imp.i384100.ne...
Back-End Developer Professional Certificate: imp.i384100.ne...
iOS Developer Professional Certificate: imp.i384100.ne...
Meta Android Developer Professional Certificate: imp.i384100.ne...
Meta Database Engineer Professional Certificate: imp.i384100.ne...
Website: openjavascript...
Twitter: / openjavascript
Thanks for watching!
For more on using Axios, see our related blog post: openjavascript.info/2022/05/03/using-axios-to-make-http-requests-get-post-put-delete/
I have been searching like crazy. This is the 3rd day in a row. and youre video finally helped me! thank you !
So happy to hear that :)
This was super helpful! Thank you 🙌
That's great to hear :)
Subscribed mate!
What is the keyboard that you are using in this tutorial?
PS: If an interviewer asks me about ajax call, can I use Axios?
Laptop keyboard, German key layout.
On the second question, yes! Ajax is what you do when you make a HTTP request. Sometimes when people use the term ajax, they are referring to using the XMLHttpRequest object to make a HTTP request. But Ajax is a broader term. You are doing Ajax whenever you make a HTTP request (including with Fetch, Axios or the XMLHttpRequest object).
Wikipedia definition:
"With Ajax, web applications can send and retrieve data from a server asynchronously (in the background) without interfering with the display and behaviour of the existing page"
This is true of all HTTP request techniques.
@@OpenJavaScript Thank you king! really cool sound coming from laptop tho (:
@@dzajakeks5539 No worries!
Yeah, sorry about that. This is one of my earlier videos. I hope that the sound quality has improved in some of my latest videos though :)
@@OpenJavaScript If it's one person in every video, then hell yeah it improved!
But yeah there is quite the difference >>>
aside from the syntax, is there any advantage it has over using a fetch api?
Good question!
One potential advantage of Axios is that it handles the status code of the response for you (will trigger catch statement in some cases). With the Fetch API, you have to do this yourself. Though, whether this is an advantage or not is really a matter of personal preference.
Axios is also popular because Fetch API was not available in NodeJS for a long time, but this is now changing in recent versions of Node.
Just in case you (or anyone else reading) are unfamiliar with handling status codes with Fetch API, I show you how to do that in this video: ruclips.net/video/hOXWY9Ng_KU/видео.html
This helped me solve my problem
Glad to hear it!
Thank you this is so helpful
Thank you.
You're welcome!
Thank you so much
Thanks it was helpful
You're welcome!
i got require is not defined error, can you help me solve this problem ?
Yes, require only works in the Node.js environment. You need to use import syntax in frontend JavaScript or use an Axios CDN link.
@@OpenJavaScript thanks, although turns out it's because ver 1.1, people says it has a kind of problem, downgraded to ver 1.0 and everytjings works just fine
At 7:00 why did u use "{ }" to wrap that function?
I was just be super careful by wrapping the handleFunction call in function scope. But it isn't actually necessary ;)
Nothing about timeouts...
supporting by subbing you. improve your audio.
Thanks for the support and for the feedback!
Is it a particular issue with this video?
For example, would you say the audio in the following, my latest video, is any better?
ruclips.net/video/JuyUXiPqGEY/видео.html
no 1080p?
Will consider it for future vidz.
Thanks for the feedback :)
The axios docs not good, its really garbage from my opinion, any library or framework need to clear docs and more explains and examples, i don’t understand the config, in their doc there’s method or something like that called paramsSerializer, this’s function in axios docs, but when im looking into open sources code i find it as an object, which means they did’t explain the library as well
I'm a Fetch person myself and now that it's natively supported in Node, no need for Axios to do GET, POST, PUT and DELETE if you don't like it!