openmicroservices.org icon indicating copy to clipboard operation
openmicroservices.org copied to clipboard

Adding support for multipart/form-data

Open judepereira opened this issue 6 years ago • 2 comments

We need to facilitate the movement of data using the Content-Type multipart/form-data.

Spec update

actions:
  my_action:
    http:
      contentType: multipart/form-data
    arguments:
      my_argument:
        in: formBody

What this adds support for

  1. Support for making requests with the content type set to multipart/form-data
    1. Each argument will be sent as a form field

judepereira avatar Jan 14 '19 08:01 judepereira

AFAICT the spec doesn't allow binary data as of now, so I think we first should add this to the spec before.

actions:
  my_action:
    http:
      contentType: multipart/form-data
    arguments:
      my_file:
        in: formBody
        contentType: binary OR image/jpeg # <- this is missing

See e.g.

  • https://tools.ietf.org/html/rfc2183
  • https://swagger.io/docs/specification/describing-request-body/file-upload/

wilzbach avatar Jan 14 '19 14:01 wilzbach

@wilzbach - according to this, it should be as follows:

arguments:
  my_file:
    in: formBody
    type: object
    contentType: */*

This is already supported in output, we can add it to the argument as well.

judepereira avatar Jan 15 '19 13:01 judepereira