const webClient = new WebClient("http://httpbin.org");
try {
const response: WebClient.Response = await webClient.get(cancellationToken, "ip");
const statusCode: number = response.statusCode;
const statusMessage: string = response.statusMessage;
const headers: http.IncomingHttpHeaders = response.headers;
const body: Buffer = response.body;
const bodyJson: any = response.bodyAsJson;
console.log(statusCode);
console.log(statusMessage);
console.log(headers);
console.log(body.toString());
console.log(bodyJson);
} finally {
await webClient.dispose();
}
-
Notifications
You must be signed in to change notification settings - Fork 0
zxteamorg/node.web-client
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published