Mastering Axios in React: API Requests, Authentication, and Advanced Techniques | React Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

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

  • @muthupandiyan4453
    @muthupandiyan4453 10 หลายเดือนก่อน

    Delete and edit video upload pannuga bro

    • @tamilskillhub
      @tamilskillhub  10 หลายเดือนก่อน +2

      Please find the example for update and delete request handler
      To Update the product we can use PUT OR PATCH
      import { useState } from "react";
      import axios from "axios";
      export default function UpdateProduct() {
      const [id, setId] = useState("");
      const [name, setName] = useState("");
      const deleteSpecificProduct = () => {
      if (id && name) {
      axios
      .put(`dummyjson.com/products/${id}`, { title: name })
      .then((res) => console.log(res.data))
      .catch((err) => console.log(err));
      }
      };
      return (
      setId(e.target.value)}
      />
      setName(e.target.value)}
      />
      Update Product Name
      );
      }
      To delete the product we can use DELETE
      import { useState } from "react";
      import axios from "axios";
      export default function DeleteProduct() {
      const [id, setId] = useState("");
      const deleteSpecificProduct = () => {
      if (id) {
      axios
      .delete(`dummyjson.com/products/${id}`)
      .then((res) => console.log(res))
      .catch((err) => console.log(err));
      }
      };
      return (
      setId(e.target.value)}
      />
      Delete Product
      );
      }

  • @MuthuDev3
    @MuthuDev3 หลายเดือนก่อน +1

    Very good video🎉🎉🎉🎉🎉❤❤❤❤❤

  • @tamilskillhub
    @tamilskillhub  10 หลายเดือนก่อน +1

    Please find the example for update and delete request handler
    To Update the product we can use PUT OR PATCH
    import { useState } from "react";
    import axios from "axios";
    export default function UpdateProduct() {
    const [id, setId] = useState("");
    const [name, setName] = useState("");
    const deleteSpecificProduct = () => {
    if (id && name) {
    axios
    .put(`dummyjson.com/products/${id}`, { title: name })
    .then((res) => console.log(res.data))
    .catch((err) => console.log(err));
    }
    };
    return (

    setId(e.target.value)}
    />
    setName(e.target.value)}
    />
    Update Product Name

    );
    }
    To delete the product we can use DELETE
    import { useState } from "react";
    import axios from "axios";
    export default function DeleteProduct() {
    const [id, setId] = useState("");
    const deleteSpecificProduct = () => {
    if (id) {
    axios
    .delete(`dummyjson.com/products/${id}`)
    .then((res) => console.log(res))
    .catch((err) => console.log(err));
    }
    };
    return (

    setId(e.target.value)}
    />
    Delete Product

    );
    }

  • @vijay0333
    @vijay0333 10 หลายเดือนก่อน

    Thank you bro for your knowledge sharing

  • @Believer-yk7th
    @Believer-yk7th 6 หลายเดือนก่อน

    Thanks 😊for this video

  • @eherman810
    @eherman810 6 หลายเดือนก่อน

    hi bro thank u for making this video. normal la api use panna network tap la esay ya security key with api pathukalam but yapadi secure key and api yarum pakama secure ra api-ya use panurathu? .env file illama? request ta onclick-la api poratha change or restrict pana madiuma react la ? video panuka bro rompa help full-la erukum thank you.

  • @vijayaselvamc
    @vijayaselvamc 7 หลายเดือนก่อน

    Very useful🎉. Thanks

  • @pubgillusiontown5959
    @pubgillusiontown5959 4 หลายเดือนก่อน

    Thank
    you

  • @ragucool9468
    @ragucool9468 10 หลายเดือนก่อน

    React redux with JWT Authentication - Sign up, Login, Logout & Private Route(access and refresh token redux state management ).how to handle token or session(state management redex store) in enterprice level application ....thanks in advance bro ... eagarly waiting bro..create enterprice level small application ( like ecommerce with cover all topics bro)

    • @tamilskillhub
      @tamilskillhub  10 หลายเดือนก่อน

      Stay tuned

    • @ragucool9468
      @ragucool9468 10 หลายเดือนก่อน

      @@tamilskillhub thanks ....eagarly waiting bro

    • @entirefactory7137
      @entirefactory7137 10 หลายเดือนก่อน

      good idea bro

  • @mohammedmohsin7851
    @mohammedmohsin7851 2 หลายเดือนก่อน

    409 error oda response eppadi access panrathu bro

    • @tamilskillhub
      @tamilskillhub  2 หลายเดือนก่อน

      You have to use the catch block and get the error