Type alias MultipartFormTransport

MultipartFormTransport: { persist?: boolean; rawStrings?: boolean; transportType: MULTIPART_FORM_DATA }

The MultipartFormTransport is a Transport that will encode request values in multipart/form-data, and should be used for any file transmission. Note that file transmission is a bit of a special case, with the representation of the data not possible to be the same. On the frontend, a file is of File type, an instance of Blob, which does not exist in Node. For this purpose it is advised to describe a file part of a Request object as of CommonFile type, and cast it as a File on the frontend and a SimpleFile on the backend. Like UrlFormTransport, if the request is of a primitive non-object type, it will be encoded as a value in a field of name "_es_data"

Type declaration

  • Optional persist?: boolean

    If this is true, the server will write incoming data to a temporary file instead of trying to store it in a string - meaning that this should be used for large files, and potentially for binary files

  • Optional rawStrings?: boolean

    Like UrlFormTransport, by default this encodes non-file values as JSON objects - but unlike url-form encoding where the URL ends up a bit ugly, there are not many downsides to this fact. Nevertheless, you may pass rawStrings: true to skip the JSON encoding.

  • transportType: MULTIPART_FORM_DATA

Generated using TypeDoc