Vsevolod Strukchinsky
e2b4580809
improve promise usage example
10 years ago
Vsevolod Strukchinsky
a14392fee2
Clarify how `body` is stringified when an object
Some think that `JSON.stringify` will be used.
10 years ago
Vsevolod Strukchinsky
a7071713f0
4.1.1
10 years ago
Vsevolod Strukchinsky
bdc1bfb2b8
Do not assign to undefined response
10 years ago
Vsevolod Strukchinsky
f677a3ef54
4.1.0
10 years ago
Vsevolod Strukchinsky
e1cbaf200b
Do not override content-type when body is plain object
10 years ago
Sindre Sorhus
bffb934194
Merge pull request #90 from floatdrop/master
Stringify plain Object in body as application/x-www-form-urlencoded
10 years ago
Vsevolod Strukchinsky
7bea9c4d33
Stringify plain Object in body as application/x-www-form-urlencoded
Closes #70
10 years ago
Sindre Sorhus
8045fc8741
use `http.STATUS_CODES` ponyfill
Since the list differ between Node.js versions: https://github.com/nodejs/io.js/commit/8be6060020
This is different than the previous `statuses` module we used as this is a strict ponyfill for the built-in list.
10 years ago
Sindre Sorhus
0ee286b86c
`from2-array` => `into-stream`
10 years ago
Sindre Sorhus
41267474ce
readme tweaks
10 years ago
Sindre Sorhus
ebf303a8d5
catch errors in the tests
10 years ago
Sindre Sorhus
082f4fd1d9
💄
10 years ago
Vsevolod Strukchinsky
f96498fa2f
4.0.0
10 years ago
Vsevolod Strukchinsky
3d664b8d9a
Fix description a little
We don't have speed comparsion and on Node >= 0.10 they will have same Agent, so this is not relevant now.
10 years ago
Vsevolod Strukchinsky
aba353f6fb
Merge pull request #88 from floatdrop/new-errors
Explicit Error classes
10 years ago
Vsevolod Strukchinsky
11680b1b68
Explicit Error classes
Closes #83 and closes #86
10 years ago
Vsevolod Strukchinsky
12c3cf53db
Remove unnecessary variable
10 years ago
Vsevolod Strukchinsky
e01aa0551d
Merge pull request #82 from floatdrop/4.0.0
4.0.0
10 years ago
Vsevolod Strukchinsky
8768176829
Small simplifications
10 years ago
Vsevolod Strukchinsky
b38a7975cc
Use unzip-response to unzip stream
10 years ago
Vsevolod Strukchinsky
00a9129b85
Add helpers for stream API
10 years ago
Vsevolod Strukchinsky
a1eb3f7801
Move setImmediate closer to sync event
> EventEmitter was made to be used as an abstraction around asynchronous events. Thus, when an event is emitted it will have happened on a different tick than when the event was set.
See https://github.com/joyent/node/issues/8470#issuecomment-58315886
10 years ago
Vsevolod Strukchinsky
16f93eaff1
Quick shims
10 years ago
Vsevolod Strukchinsky
04dbc4b728
Add Promise API
* Base logic moved into event-emitter and all APIs wrapped around it
* read-all-stream combined into one place - less code duplication
* Unzip stream now inherits all properties and function from response and returned instead of response
Closes #66
10 years ago
Vsevolod Strukchinsky
63d95b6316
Drop infinity-agent
Overall it is a bad practice to 'fix' internal modules within the other module.
I think graceful-fs (https://github.com/isaacs/node-graceful-fs#global-patching ) is good example, how to do this:
```js
var http = require('http');
var https = requrie('https');
var infinityAgent = require('infinity-agent');
infinityAgent.patch(http);
infinityAgent.patch(https);
```
This will enable global agent tuning in edge cases.
Closes #73 and closes #60
10 years ago
Vsevolod Strukchinsky
7bc82b8eb6
3.3.1
10 years ago
Vsevolod Strukchinsky
fcf35a7237
Merge pull request #81 from floatdrop/reelect-agent-on-redirect
Reselect agent on redirect from http to https
10 years ago
Vsevolod Strukchinsky
b9c33aa64e
Reselect agent on redirect from http to https
Closes #80
10 years ago
Sindre Sorhus
75cbd917fb
readme improvements
10 years ago
Sindre Sorhus
ef03307383
bump deps
10 years ago
Sindre Sorhus
29e7e958fb
use the node builtin status codes
10 years ago
Vsevolod Strukchinsky
79f1390727
Emit response event only on final request
Closes #75
10 years ago
Vsevolod Strukchinsky
2a155a8f4f
Merge pull request #78 from connyay/handle-empty-json-response
Handle empty response (204)
10 years ago
Connor Hindley
312c80d82c
do not parse json on a 204 response
10 years ago
Vsevolod Strukchinsky
3c728bc664
3.3.0
10 years ago
Vsevolod Strukchinsky
634a7440ce
Add notice about options in `url` object
10 years ago
Sindre Sorhus
ee6b3ad4f8
Merge pull request #77 from sindresorhus/path-vs-pathname
Code cleanup and pathname issue
10 years ago
Vsevolod Strukchinsky
d7a66baac7
Try pathname, if no path is specified
Closes #72
10 years ago
Vsevolod Strukchinsky
b7d4f8caca
Simplify get function and opts/arg juggling
Parse url at the top of got function and work with request object all the way down.
This reduces complexity and unnecessary delete calls in redirects.
10 years ago
Vsevolod Strukchinsky
b3452765cc
Add test on pathname in arguments
Test-case for #72
10 years ago
Vsevolod Strukchinsky
ef840f7c50
Merge pull request #76 from sindresorhus/content-length
Add content-length header in POST
10 years ago
Vsevolod Strukchinsky
3c06cca002
Move all code for options.body in one place
10 years ago
Vsevolod Strukchinsky
87d98e1f46
Add content-length header in POST
If:
- not already defined
- 'transfer-encoding' is not used
- body is not Stream
Closes #71
10 years ago
Vsevolod Strukchinsky
c1923e1494
Add error event in documentation
Closes #74
10 years ago
Sindre Sorhus
41d147baaf
minor code style improvements
10 years ago
Sindre Sorhus
550c63fcbe
use `is-redirect` module
10 years ago
Sindre Sorhus
ec19e8eff1
make git treat .ai as binary
10 years ago
Sindre Sorhus
c3ec7b7903
add `Created by` section to readme
Thanks for all the great work you've been doing on this module @floatdrop :)
10 years ago
Sindre Sorhus
ad6c4a49e9
Merge pull request #65 from sindresorhus/tap
Use node-tap for tests
10 years ago