Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Latest commit

 

History

History
30 lines (22 loc) · 776 Bytes

migration.md

File metadata and controls

30 lines (22 loc) · 776 Bytes

Migrations from the SuperAgent API

timeout

node-fetch uses the timeout property.

  • .timeout(n) becomes .setTimeout(n)
  • Only response timeouts are supported.

auth

Version of node-fetch that isomorphic-fetch uses populates the Request.auth property.

  • .auth(...) becomes .setAuth(...)
  • auto mode is not supported by fetch (see this issue)

options

  • only supported on node, browsers don't handle it well

append

  • passing in a filename will not create the fs.ReadStream for you
fluentlyFetch.get('/upload')
    .attach('file', '/path/to/file.txt')

would instead be

fluentlyFetch.get('/upload')
    .attach('file', fs.createReadStream('/path/to/file.txt'))