Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

formdata

const handleSubmit = async (e) => {
    e.preventDefault();
    const { userName, firstName, lastName, wallet_address, email, password } =
      data;
    try {
      let fd = new FormData();
      fd.append("userName", userName);
      fd.append("firstName", firstName);
      fd.append("lastName", lastName);
      fd.append("wallet_address", wallet_address);
      fd.append("email", email);
      fd.append("password", password);
      const res = await getSignUp(fd);
      console.log(res);
      window.alert(`${res.data.message}`);
    } catch (err) {
      window.alert(`${err}`);
      navigate("/signin");
    }
  };
 
PREVIOUS NEXT
Tagged: #formdata
ADD COMMENT
Topic
Name
5+7 =