
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
nexus-http
Advanced tools
nexus-http is a simple http client that allows you to make requests easily.
nexus-http
is a simple http client that allows you to make requests easily with fetch API.
npm i --save nexus-http
In a js
file remove the extra typing from the nexusHttp.get
part and .then
.
import { nexusHttp, HttpError, HttpResponse } from 'nexus-http';
nexusHttp.get<User[]>('http://localhost:3000/api/users', {
query: {
page: 1,
limit: 12,
deleted: false
}
})
.then((response: HttpResponse<User[]>) => {
// Add some logic when status is >= 200 and <= 299
})
.catch((response: HttpResponse<HttpError>) => {
// Add some logic on error
})
.finally(() => {
// Add some logic after success or error
});
With baseUrl:
import { nexusHttp, HttpError, HttpResponse } from 'nexus-http';
nexusHttp.setBaseUrl('http://localhost:3000/api/');
nexusHttp.get<User[]>('/users') // url before adding query params: http://localhost:3000/api/users
.then((response: HttpResponse<User[]>) => {
// Add some logic when status is >= 200 and <= 299
})
.catch((response: HttpResponse<HttpError>) => {
// Add some logic on error
})
.finally(() => {
// Add some logic after success or error
});
Create your own instance:
import { nexusHttp, HttpError, HttpResponse } from 'nexus-http';
const nexusHttp = new NexusHttp();
nexusHttp.get<User[]>('http://localhost:3000/api/users')
.then((response: HttpResponse<User[]>) => {
// Add some logic when status is >= 200 and <= 299
})
.catch((response: HttpResponse<HttpError>) => {
// Add some logic on error
})
.finally(() => {
// Add some logic after success or error
});
if fetch is not supported, the client use XmlClient by default.
import { nexusHttp, HttpError, HttpResponse, XmlClient } from 'nexus-http';
const nexusHttp = new NexusHttp();
nexusHttp.useClient(XmlClient);
// Now this instance of nexusHttp use the XmlClient (XMLHttpRequest)
nexusHttp.get<User[]>('http://localhost:3000/api/users')
.then((response: HttpResponse<User[]>) => {
// Add some logic when status is >= 200 and <= 299
})
.catch((response: HttpResponse<HttpError>) => {
// Add some logic on error
})
.finally(() => {
// Add some logic after success or error
});
FAQs
nexus-http is a simple http client that allows you to make requests easily.
We found that nexus-http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.