S.U il y a 3 ans
Parent
commit
6a8289f298
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      resources/js/tryitout.js

+ 4 - 1
resources/js/tryitout.js

@@ -193,6 +193,9 @@ async function executeTryOut(endpointId, form) {
         const authHeaderEl = form.querySelector('input[data-component=header]');
         if (authHeaderEl) headers[authHeaderEl.name] = authHeaderEl.dataset.prefix + authHeaderEl.value;
     }
+    if (headers['Content-Type'] === "multipart/form-data") {
+        delete headers['Content-Type'];
+    }
 
     makeAPICall(form.dataset.method, path, body, query, headers)
         .then(([responseStatus, responseContent, responseHeaders]) => {
@@ -214,4 +217,4 @@ function getPreviousSiblingUntil(elem, siblingSelector, stopSelector) {
         if (sibling.matches(stopSelector)) return null;
         sibling = sibling.previousElementSibling;
     }
-}
+}