wreq-js 2.0.1 → 2.1.0
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/wreq-js.cjs +19 -0
- package/dist/wreq-js.cjs.map +1 -1
- package/dist/wreq-js.d.cts +11 -1
- package/dist/wreq-js.d.ts +11 -1
- package/dist/wreq-js.js +19 -0
- package/dist/wreq-js.js.map +1 -1
- package/package.json +6 -6
- package/rust/wreq-js.darwin-arm64.node +0 -0
- package/rust/wreq-js.darwin-x64.node +0 -0
- package/rust/wreq-js.linux-arm64-gnu.node +0 -0
- package/rust/wreq-js.linux-x64-gnu.node +0 -0
- package/rust/wreq-js.linux-x64-musl.node +0 -0
- package/rust/wreq-js.win32-x64-msvc.node +0 -0
package/dist/wreq-js.cjs
CHANGED
|
@@ -729,6 +729,22 @@ var Session = class {
|
|
|
729
729
|
throw new RequestError(String(error));
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
+
getCookies(url) {
|
|
733
|
+
this.ensureActive();
|
|
734
|
+
try {
|
|
735
|
+
return nativeBinding.getCookies(this.id, String(url));
|
|
736
|
+
} catch (error) {
|
|
737
|
+
throw new RequestError(String(error));
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
setCookie(name, value, url) {
|
|
741
|
+
this.ensureActive();
|
|
742
|
+
try {
|
|
743
|
+
nativeBinding.setCookie(this.id, name, value, String(url));
|
|
744
|
+
} catch (error) {
|
|
745
|
+
throw new RequestError(String(error));
|
|
746
|
+
}
|
|
747
|
+
}
|
|
732
748
|
async websocket(urlOrOptions, options) {
|
|
733
749
|
this.ensureActive();
|
|
734
750
|
const normalized = normalizeSessionWebSocketArgs(urlOrOptions, options);
|
|
@@ -1210,6 +1226,9 @@ async function fetch(input, init) {
|
|
|
1210
1226
|
if (config.disableDefaultHeaders !== void 0) {
|
|
1211
1227
|
requestOptions.disableDefaultHeaders = config.disableDefaultHeaders;
|
|
1212
1228
|
}
|
|
1229
|
+
if (config.compress !== void 0) {
|
|
1230
|
+
requestOptions.compress = config.compress;
|
|
1231
|
+
}
|
|
1213
1232
|
if (headerTuples && headerTuples.length > 0) {
|
|
1214
1233
|
requestOptions.headers = headerTuples;
|
|
1215
1234
|
}
|