Understanding HTTP Request Verbs

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2020
  • This tutorial explains what endpoints, http verbs, and routes are all about, and how you can use Express, a browser, and Postman to build and test different routes.
    Postman website - www.getpostman.com/downloads/
    Code Samples from Video - gist.github.com/prof3ssorSt3v...
    Express Playlist - • Quickstart with Expres...
    Getting Started with Postman - • The Basics of Using Po...

ความคิดเห็น • 44

  • @michaelzampogna2016
    @michaelzampogna2016 3 ปีที่แล้ว

    Your voice alone validates your code...

  • @himankgupta7968
    @himankgupta7968 4 ปีที่แล้ว +3

    Thanks man..your content feels so useful..even when I know most about stuff already, there's always something new to learn with you..

  • @RameenFallschirmjager
    @RameenFallschirmjager 4 ปีที่แล้ว

    I'm very glad that your channel is growing! Keep it Boss!

  • @sakthiveladharapillai7673
    @sakthiveladharapillai7673 4 ปีที่แล้ว +1

    Hey, your tech videos are really awesome and well explained. Please keep up the good work

  • @kelvezu1585
    @kelvezu1585 4 ปีที่แล้ว

    This is the active channel I've been looking for.

  • @rickfearn3663
    @rickfearn3663 2 ปีที่แล้ว

    Exception clarity.

  • @mouhssinetarik8332
    @mouhssinetarik8332 4 ปีที่แล้ว

    You are just awesome my friend

  • @amineouadi3282
    @amineouadi3282 4 ปีที่แล้ว

    Keep it up Boss!

  • @kllokoq
    @kllokoq 2 ปีที่แล้ว +1

    I was playing around with the code (which I copy pasted from your repo) last night but I started getting the nightmarish CORS issue. After a lot of searching I found out about the the middleware cors package (which i believe you mention in one of your videos in this playlist, but i had no idea what it did) which magically solved the issue. But I was wondering how is it that you don't get that issue when you run the code? [mystery around CORS deepens further]. I am aware that you have another fantastic video on Fetch,Cors and cookies which I will be studying soon! Thank you!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว

      The cors middleware is the solution for express to allow any url to download and use the content from this server.
      If the client and server are running from the same domain then there is no cors issues.

  • @cheattube
    @cheattube 3 ปีที่แล้ว

    thanks you are great teacher

  • @debjyotibanerjee9846
    @debjyotibanerjee9846 4 ปีที่แล้ว

    Wow. Thanks.

  • @user-eu2ok5dm2f
    @user-eu2ok5dm2f 4 ปีที่แล้ว +1

    please i want your advice.
    what best these days is to decouple frontend from backend, so we have to use Rest API. or we should use template engine instead with MVC structure.
    thank you....

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว

      The only answer I can give to that question is "it depends". Both are good solutions. You can use both on the same project. There are a hundred factors that go into deciding what is best for your particular project. There is no technology that is best for every project and every situation.

  • @fourteensierra
    @fourteensierra 4 ปีที่แล้ว +1

    Hey steve thanks for another great video. I'm still going through all your videos (I just finished your mysql series last night) you're a great teacher. I'm curious what is the advantage of using the different HTTP 'verbs' over say just using a post method and sending a parameter like userid, username, etc and then on the backend using that to update or delete info? For example I currently use this code in a POST method to delete users from an Mysql table I created:
    $userId = $_POST['id'];
    $sql = "DELETE FROM login WHERE id=('$userId')";
    mysqli_query($conn, $sql);
    I know there are fundamental differences between post and get (get doesn't have a body and exposes parameters to the user in the URL bar) so its not very secure for certain things like passwords but why can't a POST method just be used for everything else?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +4

      The practice of using POST for everything came out of common usage, back before REST had been defined, when 90% of the developers were just hacking their way through things and nobody really understood the purposes of the different methods or even that they existed.
      PHP only provided $_GET and $_POST super globals and so many server-side devs thought that those were the only two.
      Servers have better support now. Languages, like JS (Node) have full support for all the methods. So, now it is a matter of educating people to use the proper tool for the job.
      Just because we CAN use POST for everything doesn't mean we should. :)

    • @fourteensierra
      @fourteensierra 4 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 Interesting, so is the main advantage of using verbs to ensure that you are conforming to the REST protocol or are there other advantages? I'd be curious what your opinion of graph QL is then. Either way, thanks for answering my question and keep up the great videos. I'm doing my best to try and raise your profile (liking, commenting, etc.) you definitely deserve more subscribers.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว

      @@fourteensierra I think GraphQL is a cool tech. Definitely has things that make life easier for the full stack developer but with anything like that there is a performance overhead and possible penalties

  • @ilovecoffee7623
    @ilovecoffee7623 4 ปีที่แล้ว

    I have a question about multipart / data-form value of the enctype attribute. Everywhere i read on the internet, it says that multipart / data-form value of the enctype is used only for POST method, but nowhere is it explained WHY. Can you explain to me why is it only used with POST method? What if i use it with GET method? and why is it only used for sending files? Why not used it to send text instead?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว

      An HTTP Request using GET has NO body. There is no data being sent other than the querystring.

  • @Sagar_Singh.
    @Sagar_Singh. 4 ปีที่แล้ว +1

    don't we need to use body parser to get access of req.body of POST method ?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +1

      Typically, I format my body as a JSON string. then, on the server in my Express script I can use the built-in Express json method to parse the body.
      app.use(express.json());
      then I will have
      req.body available with all the JSON data as objects.

    • @Sagar_Singh.
      @Sagar_Singh. 4 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 thank you 😎

  • @himankgupta7968
    @himankgupta7968 4 ปีที่แล้ว

    Also, I'm having problems sending JWT token from React Axios to Node server ( without config file, but as an attribute option along with request data ), can you help me with that?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +1

      Sorry but I can't debug your project. No time for that.
      I will be doing tutorials on JWT within the next couple months.
      I will be doing more React tutorials this summer.

    • @himankgupta7968
      @himankgupta7968 4 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 will be looking forward to your jwt tutorial then 🙌👍

  • @lookingforbino
    @lookingforbino ปีที่แล้ว

    Thanks for course. I got a question: Why the content inside data.js wasn't get update, once you made the post request of adding another person? Thanks

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  ปีที่แล้ว +1

      We would have to actual write to the file and change its contents and reread it each time

    • @lookingforbino
      @lookingforbino ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 Well, so we need to write some code to make it happen,.
      Thanks

  • @worldwide6626
    @worldwide6626 2 ปีที่แล้ว

    I have an error Property 'channels' does not exist on type 'typeof import("c:/Users/hp/Desktop/nodejsbasics/data")'

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว

      Are you using import instead of require? The syntax is different for ES Modules than Common JS.

    • @worldwide6626
      @worldwide6626 2 ปีที่แล้ว

      @@SteveGriffith-Prof3ssorSt3v3 no I am using require instead of import
      it says Cannot read property 'reduce' of undefined
      and
      cannot find module 'C:\Users\hp\Desktop
      odejsbasics\data' imported from C:\Users\hp\Desktop
      odejsbasics\app.js
      I have both data.js and app.js in the same level in my folder

    • @worldwide6626
      @worldwide6626 2 ปีที่แล้ว

      edit: your code seems to work fine when i copy pasted it. there is a problem with mine

    • @worldwide6626
      @worldwide6626 2 ปีที่แล้ว

      edit: Only my get all request function works

  • @ahmedatef3415
    @ahmedatef3415 4 ปีที่แล้ว

    Thanks man i appreciate that , but what about advanced topics if you can make micro-services applications

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +1

      Please add your tutorial requests in the comments here - th-cam.com/video/LCezax2uN3c/w-d-xo.html

  • @Signosis2007
    @Signosis2007 4 ปีที่แล้ว

    Need to have golive pluging (Live Server
    ) to bring up the HTML file like in the video.

  • @barungh
    @barungh 4 ปีที่แล้ว

    Hey boss,
    How are you doing ?
    can you please suggest me some article for more deeper or extended knowledge of HTTP and other protocols ?
    Any article, book, website, blog post anything ... I want to study ... something more theoretical
    Thank You :)

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 ปีที่แล้ว +1

      The MDN website has lots of great pages about HTTP - developer.mozilla.org/en-US/docs/Web/HTTP
      Roy Fielding's original PhD thesis that introduced REST, is a good theoretical discussion - www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

    • @barungh
      @barungh 4 ปีที่แล้ว

      @@SteveGriffith-Prof3ssorSt3v3 Thank you so much

  • @GreenAcreFarms
    @GreenAcreFarms 4 ปีที่แล้ว

    I'm searching and searching, you don't have anything about FFmpeg, do you?

  • @DeepakSingh-oj9ot
    @DeepakSingh-oj9ot 4 ปีที่แล้ว

    sir pls upload more videos