model_driven_api 3.5.7 → 3.5.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df0f02193f91b162df1248961aabf8c4281440c49dc7f3147cb400db371f68d0
4
- data.tar.gz: d0c42164dbde60bbb752110daa5e8b757ac8a7e0bfcc5e9b6a67898a02555ec8
3
+ metadata.gz: 50e6447048e37e35c8b4edeb8ddf337e9d5e8195d5bb515e69858368242a49d4
4
+ data.tar.gz: 8a902eb91707029d994c846edb09d5dea74444d7eca758dd678137c1e179be9e
5
5
  SHA512:
6
- metadata.gz: e4e3c99b867169e19e966832ef085d5d8ffd67399a6a4047fa504a950c75a63b1a96719502d8c9d01dca6efd5d32ae7d9b07d69c8c7ad361a561cde24b957d65
7
- data.tar.gz: 6bcff8f0e6c408ead804305dd386e827edf582b0e950774bcf9c79cdb9c24fe7577dab86d813e0c1a9cb8ff7e3355079f451d23eb1a8327df658824cd876b167
6
+ metadata.gz: d4b88c69f9909a692cf4c811ba50f60247e55cd8ae30d3673b4962bde51fd09e0c45736bac2cc61a3eed8c43e064555e6e1bc36d62c89bdf53307cb2160ed299
7
+ data.tar.gz: c7ffd3833e0024b58945151f7db031b053617e385480493b256f201c59949902c2eb3dae6585fc9b04a8fb3ff7942695254fc4eee4c09000b256d6821f1d8617
@@ -1303,6 +1303,58 @@ const handleUpdate = async () => {
1303
1303
  });
1304
1304
  };
1305
1305
 
1306
+ ```
1307
+
1308
+ ### 4. Bare Metal HTTP Requests
1309
+
1310
+ 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."
1311
+
1312
+ #### A. POST Request (Upload)
1313
+
1314
+ Notice how `multipart/form-data` uses a **boundary** string (randomly generated by the client) to separate different fields.
1315
+
1316
+ ```http
1317
+ POST /api/products HTTP/1.1
1318
+ Host: localhost:3000
1319
+ Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
1320
+
1321
+ ------WebKitFormBoundary7MA4YWxkTrZu0gW
1322
+ Content-Disposition: form-data; name="product[title]"
1323
+
1324
+ My New Product
1325
+ ------WebKitFormBoundary7MA4YWxkTrZu0gW
1326
+ Content-Disposition: form-data; name="product[assets][]"; filename="camera_shot.jpg"
1327
+ Content-Type: image/jpeg
1328
+
1329
+ (Binary image data goes here...)
1330
+ ------WebKitFormBoundary7MA4YWxkTrZu0gW
1331
+ Content-Disposition: form-data; name="product[assets][]"; filename="gallery_photo.png"
1332
+ Content-Type: image/png
1333
+
1334
+ (Binary image data goes here...)
1335
+ ------WebKitFormBoundary7MA4YWxkTrZu0gW--
1336
+
1337
+ ```
1338
+
1339
+ #### B. PATCH Request (Deletion via IDs)
1340
+
1341
+ When sending the `remove_assets` array via `FormData`, the key is repeated for every ID. This is how HTTP handles arrays in form data.
1342
+
1343
+ ```http
1344
+ PATCH /api/products/100 HTTP/1.1
1345
+ Host: localhost:3000
1346
+ Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXyZ123
1347
+
1348
+ ------WebKitFormBoundaryXyZ123
1349
+ Content-Disposition: form-data; name="product[remove_assets][]"
1350
+
1351
+ 12
1352
+ ------WebKitFormBoundaryXyZ123
1353
+ Content-Disposition: form-data; name="product[remove_assets][]"
1354
+
1355
+ 45
1356
+ ------WebKitFormBoundaryXyZ123--
1357
+
1306
1358
  ```
1307
1359
  MARKDOWN
1308
1360
  info
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.5.7".freeze
2
+ VERSION = "3.5.9".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.7
4
+ version: 3.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni