]> BookStack Code Mirror - bookstack/commitdiff
Added api format advisory regarding PUT/DELETE form data
authorDan Brown <redacted>
Wed, 28 Sep 2022 19:15:48 +0000 (20:15 +0100)
committerDan Brown <redacted>
Wed, 28 Sep 2022 19:15:48 +0000 (20:15 +0100)
resources/views/api-docs/parts/getting-started.blade.php

index 76da73e452f7d9810529c97de79f3d1ea80a6898..7358b5cd765e4335ead15d92937d5ac3a35a0c64 100644 (file)
 
 <ul>
     <li>application/json</li>
-    <li>application/x-www-form-urlencoded</li>
-    <li>multipart/form-data</li>
+    <li>application/x-www-form-urlencoded*</li>
+    <li>multipart/form-data*</li>
 </ul>
 
+<p>
+    <em>
+        * Form requests currently only work for POST requests due to how PHP handles request data.
+        If you need to use these formats for PUT or DELETE requests you can work around this limitation by
+        using a POST request and providing a "_method" parameter with the value equal to
+        <code>PUT</code> or <code>DELETE</code>.
+    </em>
+</p>
+
 <p>
     Regardless of format chosen, ensure you set a <code>Content-Type</code> header on requests so that the system can correctly parse your request data.
     The API is primarily designed to be interfaced using JSON, since responses are always in JSON format, hence examples in this documentation will be shown as JSON.