apinow-sdk 0.11.7 → 0.11.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.
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -159,6 +159,10 @@ class ApiNow {
|
|
|
159
159
|
if (opts.data) {
|
|
160
160
|
console.error(`txResponse: Setting data as body for ${method} request:`, opts.data);
|
|
161
161
|
fetchOptions.body = JSON.stringify(opts.data);
|
|
162
|
+
// Explicitly set Content-Length
|
|
163
|
+
if (fetchOptions.headers && typeof fetchOptions.body === 'string') {
|
|
164
|
+
fetchOptions.headers['Content-Length'] = String(Buffer.byteLength(fetchOptions.body, 'utf-8'));
|
|
165
|
+
}
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
168
|
try {
|