Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo and formatting, add colons #4853

Merged
merged 4 commits into from Sep 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -515,7 +515,7 @@ These are the available config options for making requests. Only the `url` is re
},

formSerializer: {
visitor: (value, key, path, helpers)=> {}; // custom visitor funaction to serrialize form values
visitor: (value, key, path, helpers) => {}; // custom visitor funaction to serrialize form values
dots: boolean; // use dots instead of brackets format
metaTokens: boolean; // keep special endings like {} in parameter key
indexes: boolean; // array indexes format null - no brackets, false - empty brackets, true - brackets with indexes
Expand Down Expand Up @@ -965,7 +965,7 @@ axios.post('https://httpbin.org/post', {x: 1}, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(({data})=> console.log(data));
}).then(({data}) => console.log(data));
```

In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default.
Expand All @@ -974,14 +974,14 @@ You can overload the FormData class by setting the `env.FormData` config variabl
but you probably won't need it in most cases:

```js
const axios= require('axios');
const axios = require('axios');
var FormData = require('form-data');

axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(({data})=> console.log(data));
}).then(({data}) => console.log(data));
```

Axios FormData serializer supports some special endings to perform the following operations:
Expand Down Expand Up @@ -1023,7 +1023,7 @@ const obj = {
The following steps will be executed by the Axios serializer internally:

```js
const formData= new FormData();
const formData = new FormData();
formData.append('x', '1');
formData.append('arr[]', '1');
formData.append('arr[]', '2');
Expand All @@ -1043,7 +1043,7 @@ which are just the corresponding http methods with the `Content-Type` header pre

## Files Posting

You can easily sumbit a single file
You can easily submit a single file:

```js
await axios.postForm('https://httpbin.org/post', {
Expand All @@ -1052,7 +1052,7 @@ await axios.postForm('https://httpbin.org/post', {
});
```

or multiple files as `multipart/form-data`.
or multiple files as `multipart/form-data`:

```js
await axios.postForm('https://httpbin.org/post', {
Expand Down