No recent searches
Popular Articles
Sorry! nothing found for
Posted about 3 years ago by morx05
Hi, how can i use zyte proxyRequest in node with axios ? or maybe use proxyRequest with async await?Thanks.
0 Votes
1 Comments
Paulo Mesquita posted almost 3 years ago
This works for me:
const axios = require("axios"); const tunnel = require("tunnel"); const fs = require("fs"); const path = require("path"); async function makeRequest() { const options = { url: requestUrl, method: requestMethod, httpsAgent: tunnel.httpsOverHttp({ ca: [fs.readFileSync(path.resolve(__dirname, "pathToCertificate/yourCertificate.crt"))], // You can download this from zyte API access tutorial proxy: { host: proxyHost, port: proxyPort, proxyAuth: `${proxyAPIKey}:`, }, }), }; const axiosResponse = await axios.request(options); console.log(axiosResponse); }
1 Votes
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
Hi, how can i use zyte proxyRequest in node with axios ? or maybe use proxyRequest with async await?
Thanks.
0 Votes
1 Comments
Paulo Mesquita posted almost 3 years ago
This works for me:
1 Votes
Login to post a comment