2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00
Commit Graph

5 Commits

Author SHA1 Message Date
Niklas Närhinen 2f4d0b8b45 Automatic Content-Type for FormData uploads
When data passed to axios is of type FormData we have to let the browser
create the Content-Type header so that the boundaries will get right
etc.

Usage:

```js
var data = new FormData();
data.append('field', 'some string');
data.append('file', someFile);

var opts = {
  transformRequest: function(data) { return data; }
};

axios.post('/fileupload', data, opts);

```
2014-10-23 01:49:25 +03:00
mzabriskie f406b092fc Fixing failing tests 2014-09-22 10:47:41 -06:00
Mathieu Bruyen 095a204c5b Allow ArrayBuffer and related views as data
In order to push binary data under the form of ArrayBuffer and
its related views (Int8Array, ...) one needs not to stringify
those.

For the XHR adapter there is nothing to do as it natively supports
ArrayBuffer in req.send().

Node's http adapter supports only string or Buffer thus a
transformation to Buffer is required before setting content length
header.
2014-09-18 09:17:46 +02:00
Matt Zabriskie 7aef479c7e Adding xsrf protection 2014-08-29 01:17:40 -06:00
Matt Zabriskie cec3482ff7 Moving utility functions into utils 2014-08-28 12:33:53 -06:00