{"_id":"lil-http","_rev":"7-a3ecf56995f4ea6cc3d7ee8d99076411","name":"lil-http","description":"Tiny, lightweight, full featured HTTP client","dist-tags":{"latest":"0.1.17"},"versions":{"0.1.15":{"name":"lil-http","description":"Tiny, lightweight, full featured HTTP client","version":"0.1.15","license":"MIT","repository":{"type":"git","url":"https://github.com/lil-js/http"},"author":{"name":"Tomas Aparicio"},"main":"./http.js","keywords":["lil","tiny","micro","http","request","xhr","ajax","https","agent"],"scripts":{"test":"make test"},"devDependencies":{"chai":"^1.9.1","http-server":"^0.6.1","mocha":"^1.21.3","mocha-phantomjs":"^3.4.1","phantomjs":"^1.9.7-9","sinon":"^1.10.3","stubby":"^0.2.6","uglify-js":"^2.4.15"},"gitHead":"f2c7c1c09c9906c67d740461e5537c6a08f64dc9","bugs":{"url":"https://github.com/lil-js/http/issues"},"homepage":"https://github.com/lil-js/http","_id":"lil-http@0.1.15","_shasum":"adbd33e7ce24aa2e4046551ffb321a7cbc60dec0","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.33","_npmUser":{"name":"h2non","email":"tomas@aparicio.me"},"maintainers":[{"name":"h2non","email":"tomas@aparicio.me"}],"dist":{"shasum":"adbd33e7ce24aa2e4046551ffb321a7cbc60dec0","tarball":"https://registry.npmjs.org/lil-http/-/lil-http-0.1.15.tgz","integrity":"sha512-duY1FKqg6ZcGZqOftR7ESvnJOnXmK6a9WPDLcc25HoqKcSj44q0T86XmqD/GjZ/XPqYZLOSSkQ8Z+bfgk353kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa98eH4w8/HsnbsgSxNx9yVN1mySWud16vZn26Vmxr7QIgcTh8E6qPxB7w8u+UUAuMjbHz7yWFGD1s44A46NhYt2E="}]}},"0.1.16":{"name":"lil-http","description":"Tiny, lightweight, full featured HTTP client","version":"0.1.16","license":"MIT","repository":{"type":"git","url":"https://github.com/lil-js/http"},"author":{"name":"Tomas Aparicio"},"main":"./http.js","keywords":["lil","tiny","micro","http","request","xhr","ajax","https","agent"],"scripts":{"test":"make test"},"devDependencies":{"chai":"^1.9.1","http-server":"^0.6.1","mocha":"^1.21.3","mocha-phantomjs":"^3.4.1","phantomjs":"^1.9.7-9","sinon":"^1.10.3","stubby":"^0.2.6","uglify-js":"^2.4.15"},"gitHead":"eccd0f733c958b0ddded31b48b50985f9ccffcf0","bugs":{"url":"https://github.com/lil-js/http/issues"},"homepage":"https://github.com/lil-js/http","_id":"lil-http@0.1.16","_shasum":"e81b85df3d02badf0e5b5fb06714188a709e9fa4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"h2non","email":"tomas@aparicio.me"},"maintainers":[{"name":"h2non","email":"tomas@aparicio.me"}],"dist":{"shasum":"e81b85df3d02badf0e5b5fb06714188a709e9fa4","tarball":"https://registry.npmjs.org/lil-http/-/lil-http-0.1.16.tgz","integrity":"sha512-k8he05mNfWbMn/QTY2Bc4ZoXD4boRkev6l786oL1EXmWbhFi7efu100ZjvyFer6ez+Hhvf9WneEf854W3oKgag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDUgoLKwCD+HZH+2aWiupug+XLfYXd+vkPNTLVxL70EtAiAAitBT4oSZ2R01TzrrHvdqS4hOjgeitoDxHkLsn/B9pQ=="}]}},"0.1.17":{"name":"lil-http","description":"Tiny, lightweight, full featured HTTP client","version":"0.1.17","license":"MIT","repository":{"type":"git","url":"git+https://github.com/lil-js/http.git"},"author":{"name":"Tomas Aparicio"},"main":"./http.js","keywords":["lil","tiny","micro","http","request","xhr","ajax","https","agent"],"scripts":{"test":"make test"},"devDependencies":{"chai":"^1.9.1","http-server":"^0.6.1","mocha":"^1.21.3","mocha-phantomjs":"^3.4.1","phantomjs":"^1.9.7-9","sinon":"^1.10.3","stubby":"^0.2.6","uglify-js":"^2.4.15"},"gitHead":"7f03e41ec6464c6f4ae6d98e53fb066b060075d3","bugs":{"url":"https://github.com/lil-js/http/issues"},"homepage":"https://github.com/lil-js/http#readme","_id":"lil-http@0.1.17","_shasum":"df1f58a8738aa13ed6b0b83ad21c5f6a56fcebe7","_from":".","_npmVersion":"3.5.1","_nodeVersion":"5.3.0","_npmUser":{"name":"h2non","email":"tomas@aparicio.me"},"maintainers":[{"name":"h2non","email":"tomas@aparicio.me"}],"dist":{"shasum":"df1f58a8738aa13ed6b0b83ad21c5f6a56fcebe7","tarball":"https://registry.npmjs.org/lil-http/-/lil-http-0.1.17.tgz","integrity":"sha512-wlhWcTk2L7Bnx5lkimiWJVT8fSxAM8nA2IAiDv8FfQ3xPx+cH+8Q8sZhMf0g9HSIDwgBZWSIc6aGJlaQ4zIHKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwtSEtbw0cDJns98fAeHzK8Z3Ti91JVaDlqHFG/8BI3AIgLpe1LrwMRBhysleg+ZaXHnfx1s00RgjG7Dx44jLWey8="}]}}},"readme":"# [lil](http://lil-js.github.io)'-http [![Build Status](https://api.travis-ci.org/lil-js/http.svg?branch=master)][travis] [![Stories in Ready](https://badge.waffle.io/lil-js/http.png?label=ready&title=Ready)](https://waffle.io/lil-js/http) [![Code Climate](https://codeclimate.com/github/lil-js/uri/badges/gpa.svg)](https://codeclimate.com/github/lil-js/http) [![Gitter chat](https://badges.gitter.im/lil-js/http.png)](https://gitter.im/lil-js/http)\n\n<img align=\"center\" height=\"150\" src=\"http://lil-js.github.io/img/liljs-logo.png\" />\n\nTiny, lightweight, full featured HTTP client for the browser.\n\n<table>\n<tr>\n<td><b>Name</b></td><td>http</td>\n</tr>\n<tr>\n<td><b>Version</b></td><td>0.1.17</td>\n</tr>\n<tr>\n<td><b>Size</b></td><td>3 KB / 1 KB (gzipped)</td>\n</tr>\n<tr>\n<td><b>Environment</b></td><td>Browser</td>\n</tr>\n</table>\n\n## Features\n\n- Simple fully configurable API\n- Support any HTTP verb\n- Built-in error handling\n- Binary response handling support\n- Content-Type autodiscovery\n- Support auth credentials\n- Request progress status report\n- Support passing custom headers\n- Transparent support for CORS (in IE)\n- Simple request state handling based on callback\n- Transparent payload JSON serializer\n\n## Installation\n\nVia [Bower](http://bower.io)\n```bash\nbower install lil-http\n```\n\nVia [Component](https://github.com/component/component)\n```bash\ncomponent install lil-js/http\n```\n\nOr loading the script remotely\n```html\n<script src=\"//cdn.rawgit.com/lil-js/http/0.1.17/http.js\"></script>\n```\n\n### Environments\n\n- Chrome >= 5\n- Firefox >= 3\n- Safari >= 5\n- Opera >= 10\n- IE >= 9\n\n### Usage\n\nYou could fetch de module via `require()` if it's available.\nOtherwise, global fallback will be used, exposed via `lil.http`\n\n##### Sample GET request\n```js\nlil.http.get('/sample.json', {\n  auth: { user: 'Tom', password: 'p@s$w0rD' }\n  headers: { 'X-Version': '0.1.0' }\n}, function (err, res)) {\n  if (err) throw new Error('Cannot perform the request: ' + err.status)\n  if (res.status === 200) {\n    console.log(res.data)\n  }\n})\n```\n\n##### Sample POST request\n```js\nlil.http.post('/register', {\n  data: { user: 'Tom' },\n  headers: { 'API-Key': '8c1c4180-36b5-11e4-8510-0800200c9a66' }\n}, function (err, res)) {\n  if (err) throw new Error('Cannot register: ' + err.status)\n  if (res.status === 200) {\n    console.log('Registered!')\n  }\n})\n```\n\n### Config options\n\n- **url** `string` - Server request URL\n- **data** `mixed` - Payload data to send as body request. See [MDN][sendXHR] for more information\n- **params** `object` - Map of key-value query string params\n- **headers** `object` - Map of strings representing HTTP headers to send to the server\n- **timeout** `number` - Request maximum timeout in milliseconds. Default to 30 seconds\n- **auth** `object` -  Authentication credentials to the server. Object must have the `user` and `password` properties with `string` values\n- **withCredentials** `boolean` - Whether to set the withCredentials flag on the XHR object. See [MDN][withcredentials] for more information\n- **method** `string` - Request HTTP method. Default to `GET`\n- **responseType** `string` - Define how to handle the response data. Allowed values are: `text`, `arraybuffer`, `blob` or `document`\n\n### Response/error object\n\n- **data** `mixed` - Body response. If the MIME type is `JSON-compatible`, it will be transparently parsed\n- **status** `number` - HTTP response status code\n- **headers** `object` - Response headers\n- **xhr** `object` - Original XHR instance\n- **error** `mixed` - Error info, usually an `Error` instance (in case that an error happens)\n\n## API\n\n#### http(url, options, cb, [ progressCb ])\n\n#### http.get(url, options, cb, [ progressCb ])\n\n#### http.post(url, options, cb, [ progressCb ])\n\n#### http.put(url, options, cb, [ progressCb ])\n\n#### http.delete(url, options, cb, [ progressCb ])\n\n#### http.patch(url, options, cb, [ progressCb ])\n\n#### http.head(url, options, cb, [ progressCb ])\n\n#### http.defaults\nType: `object`\n\nDefault client config object\n\n#### http.defaultContent\nType: `string` Value: `text/plain`\n\nDefault `Content-Type` request header value\n\n#### http.VERSION\n\n## Contributing\n\nWanna help? Cool! It will be appreciated :)\n\nYou must add new test cases for any new feature or refactor you do,\nalways following the same design/code patterns that already exist\n\n### Development\n\nOnly [node.js](http://nodejs.org) is required for development\n\nClone the repository\n```bash\n$ git clone https://github.com/lil-js/http.git && cd http\n```\n\nInstall dependencies\n```bash\n$ npm install\n```\n\nGenerate browser bundle source\n```bash\n$ make browser\n```\n\nRun tests\n```bash\n$ make test\n```\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT) © Tomas Aparicio\n\n[withcredentials]: https://developer.mozilla.org/es/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials\n[sendXHR]: https://developer.mozilla.org/es/docs/XMLHttpRequest#send()\n[travis]: http://travis-ci.org/lil-js/http\n","maintainers":[{"name":"h2non","email":"tomas@aparicio.me"}],"time":{"modified":"2022-06-19T12:23:13.575Z","created":"2015-01-10T15:35:09.410Z","0.1.15":"2015-01-10T15:35:09.410Z","0.1.16":"2015-01-15T00:46:40.316Z","0.1.17":"2015-12-30T14:29:54.278Z"},"homepage":"https://github.com/lil-js/http#readme","keywords":["lil","tiny","micro","http","request","xhr","ajax","https","agent"],"repository":{"type":"git","url":"git+https://github.com/lil-js/http.git"},"author":{"name":"Tomas Aparicio"},"bugs":{"url":"https://github.com/lil-js/http/issues"},"license":"MIT","readmeFilename":"README.md"}