0.0.41 • Published 3 years ago

@dainer88/node-red-contrib-send-form v0.0.41

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

node-red-contrib-send-form

This is a node-red node for posting http(s) requests containing files as multipart formData.

Installation

run npm -g install @dainer88/node-red-contrib-send-form

Features

Pulled together using some of the best of parts of other node-red-contrib nodes (particularly node-red-contrib-http-request), and the best parts of stackoverflow. Currently only sends files. Also Allows setting the url in msg.url

Usage

Required node inputs:

  • url
  • file source type:
    • base64 or binary buffer

File

  • Data | Buffer
    Needs to be passed in msg.payload.file.data
  • Name of file field | String
    Needs to be passed in msg.payload.file.field

  • Name of file | String
    Needs to be passed in msg.payload.file.name

  • Source type | String
    Can be selected within the node from a dropdown menu "type" or passed in msg.payload.file.type. Payload overrides the dropdown menu.

    Currently accepts

    • base64
    • binary

Form fields

Can be inserted within the node or passed as part of msg.payload.formOptions.<name of key>

msg.payload.formOptions.params = 'test':

is the same as

<input type=textbox name=params value="test">

Example msg.payload

msg.payload = {
  file: {
    field: 'file',
    data: msg.payload,
    type: 'binary',
    name: 'file'
  },
  formOptions: {
    params: '',
  }
}

same as:

  <form method=post enctype=multipart/form-data>
    <input type=textbox name=params value="">
    <input type=file name=file>
  </form>
0.0.40

3 years ago

0.0.41

3 years ago

0.0.39

3 years ago

0.0.37

4 years ago

0.0.38

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.34

4 years ago

0.0.33

4 years ago

0.0.32

4 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.23

4 years ago

0.0.24

4 years ago

0.0.25

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.30

4 years ago

0.0.31

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.26

4 years ago

0.0.27

4 years ago

0.0.28

4 years ago

0.0.29

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago