Fetch Headers and Why They Matter
HTML-код
- Опубликовано: 10 сен 2024
- If you have ever used fetch or XMLHttpRequest then you have worked with HTTP Requests and HTTP Responses. That also means that you have been working with Headers, which are an integral part of every Request and Response.
This tutorial explains how you can find the headers, their values, and then use that as part of your fetch process.
Code from Video: gist.github.co...
MDN reference for the Headers object: developer.mozi...
Love how these videos are kept as simple as possible, but are still explained properly without all the waffle. Definitely my go to channel.
This is powerful. I have always known there was more to the headers. I just didn't know it was this much. I bet this is just even a tip of the iceberg.
Great content!
Everytime I visit this channel I always find something which I don't know and then starts to learn it🙂
This is the best explaination about headers
Correction, I think important for newbies: arrays are not key-value pairs, an array is an ordered list aka index-value pairs (arrays don't have named keys like objects do).
Good vids, love your work, thanks a mil 👍
Love you Steve you are a true GEM. Thank you for your lovely tutorials. 🙂
Very very useful,
I was looking into 'Lorem Picsum' - Rndom Image Generator API,
and wanted to control the response
Thank You so much.
I came in to learn something and with that learned something else as well. thanks as always.
Thanks!
Thank you very much! Again.
That's us great man thanks ❤️❤️❤️
i'm sorry but something is confusing me in the code. but it's not realy related to the vid.
how does a for of loop work with resp.headers
if resp.headers is an object?
doesn't a for of loop only works with itterables?
The headers object itself is iterable.
It works the exact same way as if you used
for( let entry of myHeaders.entries() ){ }
developer.mozilla.org/en-US/docs/Web/API/Headers/entries
@@SteveGriffith-Prof3ssorSt3v3 I really appreciate the quick answer, steve.
it helped a lot.
thank you very much, i love your channel !!
awesome!
why tutorials doesn't touch the necessary part which is setting the headers in the request.
like this? - ruclips.net/video/YJ7ZgGnhN5k/видео.html
hello this does not work on a mobile or even any phone wifi for json why?
Most likely you are missing the response header from the server. The client side code should work everywhere.
@@SteveGriffith-Prof3ssorSt3v3 hello i tried many differnt lines of code and it never worked Lisa
I'll be honest: I know nothing about headers except for what they are (I'd say some kind of array of information that's returned with a file) lmao
That is actually a pretty good description. When you send an HTTP request it has a header, body, and footer. The HTTP response also has those three things. the body is where the uploaded or downloaded file (or formatted data) goes. The header is the description of where it is going, where it came from, and other meta information. The footer is for verifying that you have the whole thing.
You should start a blog.
Here ya go - dev.to/prof3ssorst3v3/you-can-convert-your-callbacks-to-promises-141n
Hi bro..
How to fetch single data from database using JavaScript
Make a video for this
I released a whole playlist on IndexedDB with JS last week
First viewer😁