Skip to content

Commit 37350fa

Browse files
committed
- Fixed: Typos
- Added: Links to the methods
1 parent e93ed8d commit 37350fa

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

Readme.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,17 @@ form.submit({
186186

187187
### Methods
188188

189-
##### _void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
189+
- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-).
190+
- [_Array_ getHeaders( [**Array** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-)
191+
- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary)
192+
- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer)
193+
- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync)
194+
- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-)
195+
- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength)
196+
- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-)
197+
- [_String_ toString()](https://github.com/form-data/form-data#string-tostring)
198+
199+
#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
190200
Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user.
191201
```javascript
192202
var form = new FormData();
@@ -206,18 +216,18 @@ form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' );
206216
form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', filesize: 1045} );
207217
```
208218

209-
##### _Array_ getHeaders( [**Array** _userHeaders_] )
219+
#### _Array_ getHeaders( [**Array** _userHeaders_] )
210220
This method ads the correct `content-type` header to the provided array of `userHeaders`.
211221

212-
##### _String_ getBoundary()
213-
Return the boundary of the formData. A boundary consists of 26x `-` followed by 24 numbers
222+
#### _String_ getBoundary()
223+
Return the boundary of the formData. A boundary consists of 26 `-` followed by 24 numbers
214224
for example:
215225
```javascript
216226
--------------------------515890814546601021194782
217227
```
218228
_Note: The boundary must be unique and may not appear in the data._
219229

220-
##### _Buffer_ getBuffer()
230+
#### _Buffer_ getBuffer()
221231
Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data.
222232

223233
```javascript
@@ -231,12 +241,12 @@ axios.post( 'https://example.com/path/to/api',
231241
)
232242
```
233243

234-
##### _Integer_ getLengthSync()
244+
#### _Integer_ getLengthSync()
235245
Same as `getLength` but synchronous.
236246

237247
_Note: getLengthSync __doesn't__ calculate streams length._
238248

239-
##### _Integer_ getLength( function _callback_ )
249+
#### _Integer_ getLength( **function** _callback_ )
240250
Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated
241251
```javascript
242252
this.getLength(function(err, length) {
@@ -252,10 +262,10 @@ this.getLength(function(err, length) {
252262
}.bind(this));
253263
```
254264

255-
##### _boolean_ hasKnownLength()
265+
#### _Boolean_ hasKnownLength()
256266
Checks if the length of added values is known.
257267

258-
##### _request_ submit( _params_, function _callback_ )
268+
#### _Request_ submit( _params_, **function** _callback_ )
259269
Submit the form to a web application.
260270
```javascript
261271
var form = new FormData();
@@ -267,7 +277,7 @@ form.submit( 'http://example.com/', function(err, res) {
267277
} );
268278
```
269279

270-
##### _String_ toString()
280+
#### _String_ toString()
271281
Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead.
272282

273283
### Integration with other libraries

0 commit comments

Comments
 (0)