From d57fdb6510f13343a88abe1977056935c624a7ee Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Thu, 15 Sep 2022 07:21:40 +0200 Subject: [PATCH] Fix typo and formatting, add colons (#4853) * Fix typo, add colons * Fix code formatting * Fix code formatting Co-authored-by: Jay --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f70e7d8..e86008c 100755 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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: @@ -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'); @@ -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', { @@ -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', {