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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df0f02193f91b162df1248961aabf8c4281440c49dc7f3147cb400db371f68d0
4
- data.tar.gz: d0c42164dbde60bbb752110daa5e8b757ac8a7e0bfcc5e9b6a67898a02555ec8
3
+ metadata.gz: f9f41789e4969e40d7ea928d17463c69b067109d104f4c5c14d2d8885670c08d
4
+ data.tar.gz: df3716c785822a97d1a17374d64193eb40408735bfc93982f1d12f9ec044a2fe
5
5
  SHA512:
6
- metadata.gz: e4e3c99b867169e19e966832ef085d5d8ffd67399a6a4047fa504a950c75a63b1a96719502d8c9d01dca6efd5d32ae7d9b07d69c8c7ad361a561cde24b957d65
7
- data.tar.gz: 6bcff8f0e6c408ead804305dd386e827edf582b0e950774bcf9c79cdb9c24fe7577dab86d813e0c1a9cb8ff7e3355079f451d23eb1a8327df658824cd876b167
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
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.5.7".freeze
2
+ VERSION = "3.5.8".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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni