Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@myunisoft/httpie
Advanced tools
A modern and light Node.js http client 🐢🚀.
The package is inspired by lukeed httpie (The use is relatively similar). This package use new Node.js http client undici under the hood.
content-type
.content-encoding
.get
, post
, put
, patch
, and del
.p-ratelimit
with the limit
option.Thanks to undici:
maxRedirections
argument.Light with seriously maintained dependencies:
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @myunisoft/httpie
# or
$ yarn add @myunisoft/httpie
The MyUnisoft httpie client is very similar to lukeed httpie http client.
import * as httpie from "@myunisoft/httpie";
try {
const { data } = await httpie.get("https://jsonplaceholder.typicode.com/posts");
console.log(data);
const response = await httpie.post("https://jsonplaceholder.typicode.com/posts", {
body: {
title: "foo",
body: "bar",
userId: 1
}
});
console.log(response.statusCode);
console.log(response.statusMessage);
console.log(response.data);
}
catch (error) {
console.log(error.message);
console.log(error.statusCode);
console.log(error.headers);
console.log(error.data);
}
Since v2.0.0 you can also use the safe
prefix API to get a Promise<Result<T, E>>
import * as httpie from "@myunisoft/httpie";
const response = (await httpie.safePost("https://jsonplaceholder.typicode.com/posts", {
body: {
title: "foo",
body: "bar",
userId: 1
}
}))
.map((response) => response.data)
.mapErr((error) => new Error("a message here!", { cause: error.data }));
.unwrap();
👀 For more examples of use please look at the root folder examples.
Read the error documentation.
Thanks goes to these wonderful people (emoji key):
Gentilhomme 💻 📖 👀 🛡️ 🐛 | PierreDemailly 💻 ⚠️ | Yefis 💻 🐛 |
MIT
FAQs
MyUnisoft Node.js HTTP client that use Undici client
The npm package @myunisoft/httpie receives a total of 703 weekly downloads. As such, @myunisoft/httpie popularity was classified as not popular.
We found that @myunisoft/httpie demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.