{"library":"restler-base","title":"restler-base","description":"restler-base is a fork of the unmaintained restler HTTP client library for Node.js, version 3.4.6. It incorporates pending pull requests and fixes from the original project, serving as the foundation for restler-promise. The library provides an event-based API for making HTTP requests with automatic serialization of post data and query strings, transparent handling of SSL, redirects, gzip/deflate, and basic auth, plus automatic deserialization of XML, JSON, and YAML responses. It supports multipart file uploads and custom deserializers. Compared to modern alternatives like axios or node-fetch, restler-base is older and uses an event-driven pattern rather than promises, though it can be wrapped with restler-promise. Release cadence is low; last release was 3.4.6. Key differentiator: it is a maintained fork of restler, preserving its specific API for legacy projects.","language":"javascript","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["npm install restler-base"],"cli":null},"imports":["import restler from 'restler-base'","import { request } from 'restler-base'","import { get, post, put, del } from 'restler-base'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import restler from 'restler-base';\n\nrestler.get('https://api.example.com/data', {\n  headers: { 'Accept': 'application/json' },\n  timeout: 5000\n}).on('complete', (result, response) => {\n  if (result instanceof Error) {\n    console.error('Error:', result.message);\n  } else {\n    console.log('Data:', result);\n  }\n});\n\nrestler.post('https://api.example.com/submit', {\n  data: { name: 'test', value: 123 },\n  headers: { 'Content-Type': 'application/json' }\n}).on('success', (data, response) => {\n  console.log('Posted successfully:', data);\n}).on('fail', (data, response) => {\n  console.error('Failed with status:', response.statusCode);\n});","lang":"typescript","description":"Demonstrates basic HTTP GET and POST using the event-based API with error handling via 'complete' and 'success'/'fail' events.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}