Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to use post method axios

 const handleClick = async () => {
    let fd = new FormData();
    fd.append("name", name);
    fd.append("password", password);
    const rep = await axios
      .post("http://localhost/php/api/students/create.php", fd)
      .catch((err) => {
        console.log(err, "axios error");
      });
    console.log(rep.data);
  };
 
PREVIOUS NEXT
Tagged: #post #method #axios
ADD COMMENT
Topic
Name
3+6 =