deno.land / std@0.166.0 / node / testdata / https_request.ts

https_request.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as https from "../https.ts";import { assert } from "../../testing/asserts.ts";import type { IncomingMessageForClient } from "../http.ts";https.request("https://localhost:4505", (res: IncomingMessageForClient) => { let data = ""; assert(res.socket); assert(Object.hasOwn(res.socket, "authorized")); // @ts-ignore socket is TLSSocket, and it has "authoried" assert(res.socket.authorized); res.on("data", (chunk) => { data += chunk; }); res.on("end", () => { console.log(data); });}).end();
std

Version Info

Tagged at
a year ago