
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
axios-fetch-request
Advanced tools
axios fetch implementation for http/2 request
for install this package, use npm or yarn
~# npm install axios-fetch-request --save
now, you need import this on your js project
import fetch from "axios-fetch-request";
const api = new fetch(/* axios config or can be enpty for default */); // you can construct axios config into fetch constructor
- NOTE: You can set params on constructor:
{
proxy: false,
headers: headers,
withCredentials: true,
jar: cookieJar
}
you can define the methods for request on GET or POST params.
- NOTE: Use Promises or Async Await functions.
//method for get request is (url, body, options) and this return promisse callback
var { data } = await api.get("https://api.google.com/auth");
/*
this return:
{
"status":"ok",
"data":"",
"url":"https://api.google.com/auth"
}
*/
You can set headers on request with param options
var { data } = await api.get("https://api.google.com/auth", false, {
headers: {
accept: "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7",
"cache-control": "max-age=0",
"sec-ch-ua":
'" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
"user-agent":
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36",
},
});
FAQs
axios fetch implementation for http/2 request
We found that axios-fetch-request 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.