const request = require("@tessin/request");
const res = await request({ url: "..." }); // GET ...
console.log(res.statusCode); // number
console.log(res.statusMessage); // string
console.log(res.headers); // {[key: string]: string}
// if "Content-Type" is "application/json" then
// content equals JSON.parse(content)
// otherwise typeof content is "string"
const content = res.content;
console.log(typeof content, content);
-
Notifications
You must be signed in to change notification settings - Fork 0
tessin/node-tessin-request
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
Releases
No releases published
Packages 0
No packages published