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 reusable HTTP request logging system that tracks request and response metadata for API calls.
Your task is to create a logging utility that:
The logger should integrate with the HTTP request/response lifecycle and collect data at both the request phase (before sending) and response phase (after receiving).
@generates
/**
* Creates a request logger that captures request and response metadata.
*
* @param {Object} config - Configuration options
* @param {Array} [config.logs] - Optional array to store log entries for testing
* @returns {Function} A function that can wrap HTTP requests
*/
function createRequestLogger(config) {
// IMPLEMENTATION HERE
}
module.exports = {
createRequestLogger
};RESTful HTTP client library with composable interceptor architecture for Node.js and browsers