Fetch with Basic Authentication

  Рет қаралды 48,623

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 45
@danielladwig3845
@danielladwig3845 5 жыл бұрын
The perfect tutorial voice
@connerallen642
@connerallen642 4 жыл бұрын
Thankyou, nowhere online mentioned that you needed to encode the user/pass to base64. This was the missing part I needed. Very helpful and easy to follow. Much appreciated
@FumaxIN
@FumaxIN 2 жыл бұрын
Okay... its just 8 seconds and gotta say your voice is sooo perfect !!! Thought I was watchin those ASMR vids😆🔥
@iamSergioCampbell
@iamSergioCampbell 4 жыл бұрын
A lot of time searching a tutorial like this. And you make it look easy. Thanks!!
@johnnymccoy
@johnnymccoy 4 жыл бұрын
You sound like a canadian Tony Stark. Awesome. Thanks for this tutorial.
@balajis1800
@balajis1800 4 жыл бұрын
In JavaScript there is fetch API helps to get query parameters. Like that there is any API available to get query parameters in Java programming.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
The properties are part of the URL object developer.mozilla.org/en-US/docs/Web/API/URL/search AND developer.mozilla.org/en-US/docs/Web/API/URL/searchParams
@chinmayjoshi3800
@chinmayjoshi3800 4 жыл бұрын
1. how to do this with xml data format? and 2. I have to pass four parameters for fetching xml format data a) ref_no b)type c)user_id d)password. in this case -I have to send 'ref_no' parameter by textbox and other three parameters I have to set in code. Can you please guide to do this? Thanks for this video!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
This video should help - kzbin.info/www/bejne/b57LqqJnrLZ6m6s. The FormData object will be the body of your fetch Request object.
@chinmayjoshi3800
@chinmayjoshi3800 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks for the link
@maycodes
@maycodes 3 жыл бұрын
Thank you so much, the pace , the clarity. SUBBED
@maycodes
@maycodes 3 жыл бұрын
How I can include Bearer Token in header for Twitter API ? Like I am trying to show tweets related to the query with Twitter recent search API. But facing problem with Authentication. I have generated Bearer token from Twitter developers account
@priyankadorle5682
@priyankadorle5682 4 жыл бұрын
How do I do authentication with URL? Could you plz let me know?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
iFrames are a messy thing to work with. Authentication usually applies to one domain. If your uses another domain then it doesn't really work. Try JWT. kzbin.info/www/bejne/h3SmnoqEoaqemrs You could use the same token in both places if you have to. Your question is very difficult to answer because there are so many different issues and different things that you could be doing or using the for.
@legaspi19
@legaspi19 2 жыл бұрын
I tried it and it works. but when i open the browser console, then call the function that fetch from the server, it instantly fetch with the basic authentication visible to the browser console. Question. is there a way to hide the authentication header just to secure the fetch calls?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
No. All headers are always visible within the browser and in the server. But you should never have a password written in your code anyway. Prompt the user for the password and append what they write. Another approach is using JWT JSON Web Tokens - kzbin.info/www/bejne/h3SmnoqEoaqemrs
@sery152
@sery152 4 жыл бұрын
Thank you for your videos! they are helpful. I tried to do the same with JWT and a bearer authorization without success, if you gonna do a video for that you'll be even greater! ;)
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Very soon actually.
@FordExplorer-rm6ew
@FordExplorer-rm6ew 4 жыл бұрын
What is apache nobrowse?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Saying that people are not allowed to see the list of contents in a directory. They must ask for a specific file.
@Hum_Befikre
@Hum_Befikre 5 жыл бұрын
hii steve can u please tell how can i fetch json of products from woocommerce in react native??
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Here is my video on making fetch calls with React - kzbin.info/www/bejne/Z6qtppJqh9CUf8U . You will have to look at the Woo Commerce documentation for the parameters they want and return.
@GuilhermeHenrique-vo1sk
@GuilhermeHenrique-vo1sk 3 жыл бұрын
do i would make this in XHR ?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
XHR has a method that you can use - developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader
@GuilhermeHenrique-vo1sk
@GuilhermeHenrique-vo1sk 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thankss !
@ieatdata2327
@ieatdata2327 6 жыл бұрын
Hi Steve can you please explain about converting xml to json..like i am fetching xml data from an api and want to convert it to json using javascript..whats the best/simplest way you would suggest for doing so? thanx
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 жыл бұрын
Tom B to be honest I wouldn't convert the data. Some APIs provide JSON and some provide XML. Sometimes you get a choice. Both formats are perfectly valid data formats. The best thing to do is learn how to read the data in either instead of writing extra code to convert the format.
@ieatdata2327
@ieatdata2327 6 жыл бұрын
i guess i hadn't looked at it this way..will try doing this thanx a lot!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 жыл бұрын
I thought I had a video that showed how to do this. Apparently I only have the Intro to XML video. I will make a video on how to read data from an XML file.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 жыл бұрын
It will be online tomorrow morning.
@ieatdata2327
@ieatdata2327 6 жыл бұрын
thanx a lot Steve!
@dolinpatel5351
@dolinpatel5351 5 жыл бұрын
Hey Steve, How can you send an API key as a header?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
As long as the API is set up to accept the key that way.
@dolinpatel5351
@dolinpatel5351 5 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 it is not set up that way. I am getting a 401 error. It is about CORS. I used Postman and it works perfectly. Can you please guide me on how to solve this issue? Thanks a lot for early reply
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
@@dolinpatel5351 it all depends on which API you are using. You have to look at the documentation for the API and see how they want you to authenticate. I have other videos on token authentication and other apis. But you need to refer to the docs for the specific API.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
When setting up the headers in your Request object. Just create another header like the one in this video. The API documentation will tell you what to use as the header name.
@maurice9660
@maurice9660 4 жыл бұрын
damn, your voice is amazing!
@1133446688
@1133446688 4 жыл бұрын
Amazing and perfect tutorial, thanks a lot!
@Colstonewall
@Colstonewall 6 жыл бұрын
Awesome! Thanks, Steve.
@muhammedbilal988
@muhammedbilal988 3 жыл бұрын
Thank you, it helps a lot
@hunting4ever389
@hunting4ever389 5 жыл бұрын
Thanks it really worked
@ELFORAIN
@ELFORAIN 4 жыл бұрын
Thank you
How to use your HOSTS file
4:32
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 2,3 М.
Using FormData Objects Effectively
13:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 37 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Auth Does NOT Have To Be Hard
17:13
Web Dev Simplified
Рет қаралды 102 М.
JavaScript Fetch with Request and Headers Objects
16:26
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 65 М.
Basic Authentication and Authorization in Express
20:23
Programming with Basar
Рет қаралды 5 М.
1.1: fetch() - Working With Data & APIs in JavaScript
15:39
The Coding Train
Рет қаралды 456 М.
AJAX Requests with Token Authentication
7:58
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 54 М.
Ten Steps to Mastering the Fetch API
2:19:52
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 49 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН