David Frank
6be7c964f8
Merge pull request #58 from item4/master
...
Add content-length header with form-data
2016-03-09 23:54:23 +08:00
David Frank
b21dd5a15b
Merge pull request #39 from kirill-konshin/master
...
Refactor Body, so both Request and Response finally has common Body methods like text/json
2016-02-18 14:06:08 +08:00
Kirill Konshin
e658483ebe
Fix for #38 and #36
...
Support string/buffer bodies in Response constructor
Request should have Body methods like text(), json()
2016-02-17 10:50:55 -08:00
Kim Jin Su
d60e9acbca
Add content-length header with form-data
...
Old source do not add content-length header automatically
with form-data. If body is instance of form-data, Users
must missing this header. It cause parse error with some
server engine like WSGI. WSGI must drop body if this was not
set, and WSGI based frameworks such as flask can not read
form data.
For example, this python code with flask..
----
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/', method=['POST'])
def index():
return jsonify(**request.form)
app.run()
----
Can not receive any data from this code.
----
require('es6-promise').polyfill();
var fetch = require('isomorphic-fetch'); // it use node-fetch
var FormData = require('form-data');
var data = new FormData();
data.append('name', 'item4');
data.append('message', 'it is test!');
fetch('http://localhost:5000 ', {method: 'POST', body: data})
.then(function (data) {
return data.json();
})
.then(function (data) {
console.log(data);
});
----
This commit just use FormData's getLengthSync method.
2015-11-26 06:54:51 +09:00
David Frank
38b1fc0450
Merge pull request #54 from tricoder42/foreach
...
Add Headers.forEach method.
2015-10-28 17:37:56 +08:00
Tomáš Ehrlich
751cf6cd29
Add Headers.forEach method.
2015-10-27 06:13:02 +01:00
David Frank
fd3f89fcd9
1.3.3
2015-09-28 23:09:59 +08:00
David Frank
017ffc9607
Merge pull request #48 from bitinn/bugfix
...
Prepare for v1.3.3 release
2015-09-28 23:07:25 +08:00
David Frank
cf128ddfb8
make sure we test with transform stream
2015-09-28 23:04:14 +08:00
David Frank
a7bb74b040
update changelog
2015-09-28 22:48:11 +08:00
David Frank
6072402eb6
test case for Response ctor
2015-09-28 22:39:53 +08:00
David Frank
b48757013a
per spec, follow redirect with GET request
2015-09-28 22:30:41 +08:00
David Frank
8f02a2b77c
handle body stream error
2015-09-28 21:58:45 +08:00
David Frank
a3e14b503a
make sure we support latest node and legacy node
2015-09-28 20:46:39 +08:00
David Frank
cfe98cdd35
make sure we don't overwrite existing content-length
2015-09-28 19:27:57 +08:00
David Frank
c22bfa8189
auto add content-length on for string body
2015-09-28 17:40:58 +08:00
David Frank
906e764476
Explain limitation on Request and Response ctor
2015-09-11 12:13:04 +08:00
David Frank
917c34f449
Merge pull request #37 from kirill-konshin/master
...
Fix for #33
2015-08-10 00:23:58 +08:00
Kirill Konshin
765aef29f8
Fix for #33
...
Added parsing of Headers in Response & Request constructors
2015-08-08 19:43:55 -07:00
David Frank
129d9338a9
1.3.2
2015-07-22 15:51:49 +08:00
David Frank
7afa020f4e
Merge pull request #32 from bitinn/new-release
...
additional tests for the new form-data integration
2015-07-22 15:51:22 +08:00
David Frank
565ec4b35a
additional tests for the new form-data integration
2015-07-22 15:40:52 +08:00
David Frank
18b0f5090a
Merge pull request #31 from DylanPiercey/master
...
Automatically pull headers from node-form-data.
2015-07-22 14:41:59 +08:00
Dylan Piercey
ffac4177b0
Automatically pull headers from node-form-data.
2015-07-22 02:05:06 +00:00
David Frank
b5579eb34d
1.3.1
2015-07-11 19:44:43 +08:00
David Frank
1c67d40567
Merge pull request #29 from bitinn/new-release
...
New release
2015-07-11 19:44:26 +08:00
David Frank
ebaf735cc2
mark release
2015-07-11 19:39:16 +08:00
David Frank
b64073c64c
update comment to explain hack, make use of inpsect route in test, and update changelog
2015-07-11 19:38:26 +08:00
David Frank
5d153728f9
Merge pull request #28 from matthew-andrews/custom-host
...
Allow a custom host to be set
2015-07-11 19:25:23 +08:00
Matthew Andrews
61fad6a76a
Add hack to allow the host to be customized
2015-07-11 10:37:51 +01:00
Matthew Andrews
e98f22b3ba
Add failing test for the ability to set a custom header
2015-07-11 10:37:51 +01:00
David Frank
32b6063443
1.3.0
2015-06-04 12:42:43 +08:00
David Frank
3b3a96d9e4
Merge pull request #26 from bitinn/refactor-request
...
Refactor request
2015-06-04 12:42:01 +08:00
David Frank
feb4808a22
allow request wrapping
2015-06-04 12:40:01 +08:00
David Frank
b52b56415f
update doc
2015-06-04 12:21:05 +08:00
David Frank
9b5330dfe3
add basic test case for request
2015-06-04 12:12:27 +08:00
David Frank
694b2300f9
basic refactor for request
2015-06-04 12:05:01 +08:00
David Frank
177d42e001
1.2.1
2015-05-04 12:07:56 +08:00
David Frank
bd6d99e16b
update changelog
2015-05-04 12:07:38 +08:00
David Frank
a322795339
handle common mistake of passing number as header
2015-05-04 12:05:06 +08:00
David Frank
60f819f0a0
1.2.0
2015-05-03 18:07:34 +08:00
David Frank
55cde9e7de
update document
2015-05-03 18:07:20 +08:00
David Frank
c2cbd0be15
Merge pull request #18 from wheresrhys/response-headers
...
lgtm, thx!
2015-05-03 18:00:29 +08:00
Rhys Evans
5e4d9b1a60
expose response and headers constructors
2015-05-03 09:43:59 +01:00
David Frank
377bce655f
1.1.2
2015-04-29 12:17:26 +08:00
David Frank
6fdde43a61
changelog update
2015-04-29 12:17:18 +08:00
David Frank
596232fd90
better test for headers, only support string and array
2015-04-29 12:15:08 +08:00
David Frank
c02cb4229d
1.1.1
2015-04-22 23:36:21 +08:00
David Frank
19dcea47f1
add Headers support
2015-04-22 23:36:11 +08:00
David Frank
c363782b0a
1.1.0
2015-04-17 13:32:25 +08:00