Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

React Post - Failed to read the request form. Missing content-type boundary

$
0
0

**Full Error Messgae **failed to submit form data: {"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-fdda1dac095716c63825b02466442e3b-9b4d9bc09fab1e4e-00","errors":{"":["Failed to read the request form. Missing content-type boundary."]}}

const handleSubmit = async (event) => {    event.preventDefault();    try {      const response = await fetch("http://192.168.1.73:5077/api/Account", {        method: "POST",        body: JSON.stringify(formData),        headers: {"Content-Type": "multipart/form-data",        },      });      if (response.ok) {        console.log("Form data submitted successfully");        alert("Form data submitted successfully");        router.push("/login");      } else {        const errorMessage = await response.text();        console.error(`Failed to submit form data: ${errorMessage}`);        alert(`Failed to submit form data: ${errorMessage}`);      }    } catch (error) {      console.error("Error:", error);    }  };

Swagger API Structureenter image description hereenter image description here

HI,Please help me out on this as I am not able to Post/Submit data.Forfrontend: react Next JSBackend: .net Web API


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>