Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
apicase-adapter-fetch
Advanced tools
Fetch adapter for apicase-core
Fetch adapter is out-of-the-box adapter and it's installed in apicase-core by default
apicase.call({
adapter: 'fetch',
parser: 'json',
url: '/api/posts',
method: 'GET',
headers: { token: 'my_secret_token' },
query: { userId: 1 }
})
.then(console.log)
.catch(console.error)
It will call:
fetch('/api/posts?userId=1', {
method: 'GET',
headers: { token: 'my_secret_token' }
})
.then(res => res.json())
.then(console.log)
.catch(console.error)
Fetch adapter also has path-to-regexp to pass urls params smarter. Params are stored in params property
apicase.call({
adapter: 'fetch',
url: '/api/posts/:id',
params: { id: 1 }
})
// => GET /api/posts/1
If you want to create dynamic headers object so you can pass headers property as function that returns headers object
apicase.call({
adapter: 'fetch',
url: '/api/posts',
method: 'POST',
headers: () => ({
token: localStorage.getItem('token')
})
})
It will be called every time you make a request so if token will be removed, header won't be sent too.
MIT
FAQs
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
The npm package apicase-adapter-fetch receives a total of 0 weekly downloads. As such, apicase-adapter-fetch popularity was classified as not popular.
We found that apicase-adapter-fetch 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.