tessl install tessl/npm-rest@2.0.0RESTful HTTP client library with composable interceptor architecture for Node.js and browsers
Agent Success
Agent success rate when using this tile
76%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.29x
Baseline
Agent success rate without this tile
59%
Build a simple API request manager that makes HTTP requests with configurable timeout handling. The manager should automatically cancel requests that take too long to complete.
Your solution should:
Create a request manager that:
When a request times out:
When a request completes within the timeout:
@generates
/**
* Creates a request manager with timeout support
*
* @param {number} timeoutMs - Default timeout in milliseconds
* @returns {Object} Request manager with makeRequest method
*/
function createRequestManager(timeoutMs) {
// IMPLEMENTATION HERE
}
/**
* Makes an HTTP GET request with timeout handling
*
* @param {string} url - The URL to request
* @returns {Promise} Promise that resolves with response or rejects on timeout
*/
// makeRequest method should be available on the returned object
module.exports = {
createRequestManager
};Provides RESTful HTTP client functionality with interceptor support and timeout handling.