Action required by all clients that make use of the JavaScript Transporter Data Feeds : Transitioning to Fetch from Requests
The JavaScript Transporter in Data Feed Manager now supports the Fetch. Fetch is a modern JavaScript interface for making HTTP requests, replacing the older Request library. While we continue to support Request for now, we encourage users to transition to Fetch. The end-of-support date for Request has not been determined yet, we will provide updates here with ample notice before discontinuing support.
Why the Change?
The Request library has been deprecated and is no longer actively maintained. While it remains functional, transitioning to Fetch provides:
· Better Performance & Security: Optimized for modern web standards without requiring additional dependencies.
· Native Promise Support: A cleaner, more flexible way to handle asynchronous data.
· Future-Proofing: Ensuring compatibility with future updates.
What This Means for You
· Immediate Support: You can start using Fetch in your scripts now while Request remains temporarily available.
· Action Required: We recommend updating your scripts to use Fetch to avoid future disruptions.
· Official Script Updates: Archer will update all scripts provided through Archer Exchange.
Availability
· SaaS: Available starting with version 2025.02 (Live Now)
· On-Premise: Available starting with version 2024.11.1
Example: Migrating from Request to Fetch
Note: There are multiple ways to reference this library in your scripts. You will need to review them and ensure you appropriately alter the references.
Old Code (Using request):
const request = require('request');
request('https://api.example.com/data', { json: true }, (err, res, body) => {
if (err) { return console.error(err); }
console.log(body);
});
New Code (Using Fetch):
async function fetchData() {
try {
const response = await fetch('https://api.example.com/data');
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error('Fetch error:', error);
}
}
fetchData();
Next Steps
Users are encouraged to transition to Fetch. While Request is still available for now, an official end-of-support date and timeline will be announced in a future update with adequate notice.
For any questions or assistance, Please reply below.
Comments
0 comments
Please sign in to leave a comment.