model_driven_api 3.5.7 → 3.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/info_controller.rb +56 -0
- data/lib/model_driven_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9f41789e4969e40d7ea928d17463c69b067109d104f4c5c14d2d8885670c08d
|
|
4
|
+
data.tar.gz: df3716c785822a97d1a17374d64193eb40408735bfc93982f1d12f9ec044a2fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d6a4d31ecdb991590f78fdafca0b955f833e01abce3796cc69b70626d65201023fe2582b610941aab91834a621849f37fead2241cec4b497a3c758fb3f5b376
|
|
7
|
+
data.tar.gz: de120a2d0bfbe673d69695a44e2105fe8f16c13b422cefefa6f97ad93a8e40e04fa376e06242fd6b6005b796d0e3e00580fb3b77da2fe7d44d34eeb576a9ac82
|
|
@@ -1303,6 +1303,62 @@ const handleUpdate = async () => {
|
|
|
1303
1303
|
});
|
|
1304
1304
|
};
|
|
1305
1305
|
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
Here is the addition to the documentation showing the raw HTTP requests.
|
|
1309
|
+
|
|
1310
|
+
---
|
|
1311
|
+
|
|
1312
|
+
## 4. Bare Metal HTTP Requests
|
|
1313
|
+
|
|
1314
|
+
If you were to inspect the network traffic or manually construct the request (e.g., using raw sockets or a tool like Postman/Insomnia), this is exactly what the payload looks like "over the wire."
|
|
1315
|
+
|
|
1316
|
+
### A. POST Request (Upload)
|
|
1317
|
+
|
|
1318
|
+
Notice how `multipart/form-data` uses a **boundary** string (randomly generated by the client) to separate different fields.
|
|
1319
|
+
|
|
1320
|
+
```http
|
|
1321
|
+
POST /api/products HTTP/1.1
|
|
1322
|
+
Host: localhost:3000
|
|
1323
|
+
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
|
|
1324
|
+
|
|
1325
|
+
------WebKitFormBoundary7MA4YWxkTrZu0gW
|
|
1326
|
+
Content-Disposition: form-data; name="product[title]"
|
|
1327
|
+
|
|
1328
|
+
My New Product
|
|
1329
|
+
------WebKitFormBoundary7MA4YWxkTrZu0gW
|
|
1330
|
+
Content-Disposition: form-data; name="product[assets][]"; filename="camera_shot.jpg"
|
|
1331
|
+
Content-Type: image/jpeg
|
|
1332
|
+
|
|
1333
|
+
(Binary image data goes here...)
|
|
1334
|
+
------WebKitFormBoundary7MA4YWxkTrZu0gW
|
|
1335
|
+
Content-Disposition: form-data; name="product[assets][]"; filename="gallery_photo.png"
|
|
1336
|
+
Content-Type: image/png
|
|
1337
|
+
|
|
1338
|
+
(Binary image data goes here...)
|
|
1339
|
+
------WebKitFormBoundary7MA4YWxkTrZu0gW--
|
|
1340
|
+
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
### B. PATCH Request (Deletion via IDs)
|
|
1344
|
+
|
|
1345
|
+
When sending the `remove_assets` array via `FormData`, the key is repeated for every ID. This is how HTTP handles arrays in form data.
|
|
1346
|
+
|
|
1347
|
+
```http
|
|
1348
|
+
PATCH /api/products/100 HTTP/1.1
|
|
1349
|
+
Host: localhost:3000
|
|
1350
|
+
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXyZ123
|
|
1351
|
+
|
|
1352
|
+
------WebKitFormBoundaryXyZ123
|
|
1353
|
+
Content-Disposition: form-data; name="product[remove_assets][]"
|
|
1354
|
+
|
|
1355
|
+
12
|
|
1356
|
+
------WebKitFormBoundaryXyZ123
|
|
1357
|
+
Content-Disposition: form-data; name="product[remove_assets][]"
|
|
1358
|
+
|
|
1359
|
+
45
|
|
1360
|
+
------WebKitFormBoundaryXyZ123--
|
|
1361
|
+
|
|
1306
1362
|
```
|
|
1307
1363
|
MARKDOWN
|
|
1308
1364
|
info
|