@insignia-education/api-sdk-js 0.15.60 → 0.15.61

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Client.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.60",
3
+ "version": "0.15.61",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/Client.js CHANGED
@@ -93,8 +93,11 @@ export default class InsigniaClient {
93
93
  if (this.#baseUrl.includes('ngrok')) headers['ngrok-skip-browser-warning'] = 'true';
94
94
  const cookie = this.#cookieHeader();
95
95
  if (cookie) headers.Cookie = cookie;
96
+ // POST, not PUT: PHP only parses multipart/form-data bodies into $_FILES for
97
+ // POST requests — a PUT with the exact same body leaves $_FILES empty and the
98
+ // raw body unread, so `$request->file(...)` is always null server-side.
96
99
  const response = await fetch(`${this.#baseUrl}${path}`, {
97
- method: 'PUT', headers, credentials: 'include', body: formData,
100
+ method: 'POST', headers, credentials: 'include', body: formData,
98
101
  });
99
102
  this.#storeCookies(response);
100
103
  if (!response.ok) {