You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/runtime-apis/nodejs/https.mdx
+44-34Lines changed: 44 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ pcx_content_type: configuration
3
3
title: https
4
4
---
5
5
6
-
import { Render } from"~/components"
6
+
import { Render } from"~/components";
7
7
8
8
<Renderfile="nodejs-compat-howto" />
9
9
@@ -18,11 +18,11 @@ implementation of `Agent` in Workers is a stub implementation that does not supp
18
18
pooling or keep-alive.
19
19
20
20
```js
21
-
import { Agent } from'node:https';
22
-
import { strictEqual } from'node:assert';
21
+
import { Agent } from"node:https";
22
+
import { strictEqual } from"node:assert";
23
23
24
24
constagent=newAgent();
25
-
strictEqual(agent.protocol, 'https:');
25
+
strictEqual(agent.protocol, "https:");
26
26
```
27
27
28
28
## get
@@ -32,20 +32,25 @@ An implementation of the Node.js [`https.get'](https://nodejs.org/docs/latest/ap
32
32
The [`get`](https://nodejs.org/docs/latest/api/https.html#httpsgetoptions-callback) method performs a GET request to the specified URL and invokes the callback with the response. This is a convenience method that simplifies making HTTPS GET requests without manually configuring request options.
@@ -55,27 +60,32 @@ An implementation of the Node.js [`https.request'](https://nodejs.org/docs/lates
55
60
The [`request`](https://nodejs.org/docs/latest/api/https.html#httpsrequestoptions-callback) method creates an HTTPS request with customizable options like method, headers, and body. It provides full control over the request configuration and returns a [writable stream](https://developers.cloudflare.com/workers/runtime-apis/streams/writablestream/) for sending request data.
56
61
57
62
Request method accepts all options from `http.request` with some differences in default values:
0 commit comments