title: How to submit a multipart image - Error: Multipart: Boundary not found
body: <p>I have a client side javascript sdk that submits an image to a server side node.js api that uses the multer library to parse the image.</p>
  
  <p>However ive noticed if i set a header to be <code>content-type</code> <code>multipart-formdata</code> multer will throw an error saying </p>
  
  <blockquote>
    <p>Error: Multipart: Boundary not found</p>
  </blockquote>
  
  <pre><code>async submitDocument(id, side, image) {
  
          const url = this.API_URL + "/api/document";
  
          let formData = new FormData();
          formData.set("image", image, "front.jpg");
          formData.set("side", side);
  
          let headers = new Headers();
          headers.set("content-type", "multipart/form-data");
          headers.set("Authorization", "Bearer " + this.API_KEY);
  
          const request = {
              method: "POST",
              body: formData,
              headers: headers,
          };
  
          try {
  
              const response = await fetch(url, request);
              const data = await response.json();
  
              return data;
  
          } catch (err) {
              throw err;
          }
  
      }
  </code></pre>