diff --git a/src/index.js b/src/index.js index f5701e9..7af2f6a 100644 --- a/src/index.js +++ b/src/index.js @@ -111,7 +111,12 @@ export default (config = {}) => { retryDelay } if (options.form === true) { - request.form = payload || {} + const formData = payload || {} + const requestData = new FormData() + Object.keys(formData).forEach(function (meta) { + requestData.append(meta, formData[meta]) + }) + request.body = requestData } else if (options.multipart !== true) { request.json = true request.body = payload