Update data using a PUT request in JavaScript

  Рет қаралды 13,195

Tech Industry Analysis

Tech Industry Analysis

2 жыл бұрын

To use a PUT request using JavaScript, specify the data that should be updated.
In our example, we get specific and identify the article post we'd like to update by said post's id value.
This id is referenced in the url endpoint. Accordingly, this enables us to point to the data we want and change it via a PUT request that "carries" a payload of new data.
If you guys have questions about what's an API, look at this video,
• API Request methods
If you have questions about what a request method is view this video,
• API Request methods
The following are videos of how to implement specific methods,
POST: • Use JavaScript to POST...
GET: • Execute an API GET req...
Best,
Fido
-----------------------------------------------------------------------------------------
Book a private technical consultation 💻:: selftaughthustle.net
Follow me on instagram 📸 : @selftaughthustle
Build a software solution for your business entity 💼:: guavalabs.io
Check out Guava Lab's KZbin 📺:: kzbin.info/door/Ha8
*/

Пікірлер: 12
@Pavel-wj7gy
@Pavel-wj7gy Жыл бұрын
You should've added headers: { 'Content-Type': 'application/json' }, to your options object. If you don't and send PUT request to the actual server, it will delete the "posts/4" resource entirely leaving only ID.
@TechIndustryAnalysis
@TechIndustryAnalysis Жыл бұрын
Great catch
@martini9388
@martini9388 5 ай бұрын
Awesome tutorial! So many good qualities in one place: very easy to follow, explains just what it needs in to (but in depth), also doesn't add any extra unnecessary bs. Thx for your work Sir! Whata, just 700 subs, you deserve way more!
@youssefosama973
@youssefosama973 5 күн бұрын
if there is an json element in the server consists of 20 item for example and i want to change one value only without writting the whole element again , how to do it...
@just_dodge_lmao2971
@just_dodge_lmao2971 Жыл бұрын
Great video, thank you
@TechIndustryAnalysis
@TechIndustryAnalysis Жыл бұрын
Super happy it helped!
@just_dodge_lmao2971
@just_dodge_lmao2971 Жыл бұрын
@@TechIndustryAnalysis you really saved my ass
@mohammad_alhalla30
@mohammad_alhalla30 Жыл бұрын
I like this video, please make some playlists for your videos and collect it to make it easy to search and brows videos in ur channel
@TechIndustryAnalysis
@TechIndustryAnalysis Жыл бұрын
Appreciate it, and great suggestion
@philcoding
@philcoding Жыл бұрын
which theme you're using on your vscode?
@TechIndustryAnalysis
@TechIndustryAnalysis Жыл бұрын
Arc Dark, it should be an available default
How to use fetch in JavaScript: GET, POST, PUT and DELETE requests
23:14
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 25 МЛН
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 36 МЛН
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 9 МЛН
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,1 МЛН
Fetch API with Async/Await (GET, POST, PUT, DELETE)
14:55
ByteGrad
Рет қаралды 23 М.
JavaScript Fetch API - One Mistake I ALWAYS MAKE!
4:47
James Q Quick
Рет қаралды 21 М.
POST form data using JavaScript's Fetch API
8:01
OpenJavaScript
Рет қаралды 42 М.
Learn Fetch API In 6 Minutes
6:35
Web Dev Simplified
Рет қаралды 1,2 МЛН
HTTP Request Methods | GET, POST, PUT, DELETE
3:01
Curious Code
Рет қаралды 81 М.
1.1: fetch() - Working With Data & APIs in JavaScript
15:39
The Coding Train
Рет қаралды 450 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 25 МЛН