needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.

MIT License

Downloads
32.1M
Stars
1.6K
Committers
79

Bot releases are hidden (Show)

needle - v1.4.2

Published by tomas almost 8 years ago

  • Allow setting proxy via defaults (#194).
needle - v1.4.1

Published by tomas almost 8 years ago

Just some cleanup and a haircut.

needle - v1.4.0

Published by tomas almost 8 years ago

  • If output is requested, make sure callback is called after the file written to is closed. (#193)
  • Added err and timeout events to output stream object.
needle - v1.3.0

Published by tomas almost 8 years ago

  • Added 307 as a valid redirection code (#189, thanks @lauracpierre)
  • Persist cookies across redirects when follow_set_cookies is true (#191 and #129, thanks @icemilo and @rchipka)
needle - v1.1.0

Published by tomas about 8 years ago

  • Convert all headers to lowercase when reading and setting. Fixes #167.
  • Ensure request URLs are urlencoded. Fixes #171.
  • Fixed parse_response behaviour when set via defaults. Fixes #169.
  • Handle japanese/chinese chars correctly when building multipart bodies. Fixes #97.
  • Handle and bubble up error events that occur at decompressor level (#172).
  • Fixed open file descriptor bug (#181) when using output option.
needle - v1.0.0

Published by tomas over 8 years ago

  • Removed Connection: close header by default, unless running node < 0.11.4. This should make multiple requests to a server run much faster. More info about this on the readme.
  • Improved the way post bodies can be set through parameters. Nothing breaking though.
  • Ensure socket 'end' listener is removed, otherwise we might get 'possible event emitter leak' as those sockets get reused. This fixes the issue reported on #126, where posting huge strings would break Needle.
  • Added support for checkServerIdentity option for TLS.
needle - v0.11.0

Published by tomas almost 9 years ago

  • Added rdf+xml to the list of parseable XML content types. Fixes #136
  • Added .patch() method.
  • Fix writing to output file. Closes #140
  • Added 'header' event to stream response, that includes both statusCode and headers.
  • Changed JSON.parse() to require() in needle.js, allowing needle to run with browserify.
needle - v0.10.0

Published by tomas over 9 years ago

  • Allow setting parse/parse_response option to 'xml' or 'json' in order to skip parsing unwanted types.
  • Better handling of URLs with no protocol. needle.post('//foobar.com') should work now.
needle - v0.9.2

Published by tomas over 9 years ago

  • New cookie parsing strategy (based on RFC 6265), thanks to the work by @jorgeaguirre.
needle - v0.9.1

Published by tomas over 9 years ago

  • Fixed Host header name in redirects.
  • More informative message on querystring errors.
  • Fix for follow_set_cookies when no cookies are received (#121).
needle - v0.9.0

Published by tomas over 9 years ago

  • Added .parser property to response ('xml' or 'json' depending on the parser used).
  • Added read_timeout option, disabled by default.
  • Set utf-8 charset in Content-Type header for JSON requests.
  • Added debug module as a dependency.
  • Updated documentation.
needle - v0.8.2

Published by tomas over 9 years ago

  • Fixed global variable leak. Thanks @bausmeier!
needle - v0.7.0

Published by tomas over 9 years ago

Api changes between v0.6 and v0.7

In version 0.7 a lot of work was done on the Needle internals to make streams a first class citizen. Needle can now be used as a streams2-compatible stream and you gain a lot of performance improvements come with it.

While great care was taken not to introduce any breaking changes, there are probably a few edge cases in which Needle's behaviour has changed, specifically:

  • Needle now emits a strict streams2-compatible stream. This means that if your code relied on the Needle stream to always be in flowing mode, your code will likely need an update. For more information about this new Stream behavior, please refer to the Node.JS blog.
  • In the v0.6 release, Needle's stream didn't parse, uncompress or did anything to the body content: everything chunk of data that was emitted on the stream was the raw body. In the 0.7 release every chunk of data will be a fully processed chunk, including uncompression, character recoding and parsing (in case of XML/JSON).

If you use the regular callback interface of Needle, this will be a backwards-compatible upgrade.

needle - v0.8.1

Published by tomas over 9 years ago

  • Added follow_set_referer option.
  • Fixed cookie parsing.
  • Stricter checks when checking options (you'll now get an error when passing a string to an option that expects a boolean).
needle - v0.8.0

Published by tomas over 9 years ago

This version introduces a number of new things:

  • Cookie support
  • Fine tuning for following redirects (follow_keep_method, follow_if_same_host, follow_if_same_protocol, etc)
  • Much better memory handling (lower footprint)
  • Better proxy authentication (you can now pass a proxy URL with user/pass, e.g. http://user:[email protected])
  • And a bit of code refactoring.

Important changes:

  • follow: true will no longer default to 10 redirects. You now need to explicitly pass a number.
  • timeout: true will no longer default to 10000 milisecs. Same as above, a number is expected.