Arbitrary Integration Request Content Support
Glyue supports building integration web service APIs that receive any arbitrary binary content (e.g. documents, bulk CSV data files, audio/video streams, archives)
Integration execution endpoints can be passed body content that isn't a single JSON or XML payload. When this occurs, the request's body is converted into one or multiple GlyueFileHandle
objects and then passed into Glyue's integration engine for processing.
The term "file upload integration" is used to reference integrations that accept input data that isn't represented as JSON or XML.
Execution requests to file upload integrations are subject to the following rules:
HTTP Method | HTTP Request with Single File | HTTP Request with Multiple Files |
---|---|---|
POST | supported | supported |
PUT | supported | rejected (415 unsupported media type) |
PATCH | supported | rejected (415 unsupported media type) |
GET | accepted but body is ignored | accepted but body is ignored |
DELETE | accepted but body is ignored | accepted but body is ignored |
By default, integration endpoints only accept POST requests. Web Service Endpoints must be created to enable integration execution via other HTTP methods as documented in the Building a RESTful CRUD Web Service how-to guide and the Web Service Endpoints reference page.
Content-Type Handling
Glyue parses integration web service HTTP(S) bodies in accordance with the request's Content-Type
header value. The following behavior is enforced:
HTTP Request Content-Type(s) | Body Parsing Behavior |
---|---|
| Parsed as JSON into Pythonic data structure |
| Parsed as XML into Pythonic data structure |
| Parsed into one or more |
| Parsed into one |
It is possible to submit a single file in a multipart/form-data
request.
Multipart / Form-Data Content Requirements
Glyue assumes that the name of the field in the form data is the name of the file in that field.
Non-file form data will appear in input.payload
while the files will appear in input.files
as shown below.
|
|
|
|
| (file data) |
| (file data) |
Single Binary / File Upload Requirements
Content type for these requests will vary depending on the file being sent. Some common content types that apply are application/zip
, application/pdf
, image/png
, audio/mpeg
, video/mp4
, application/octet-stream
.
Content-Disposition Header
In order for Glyue to be aware of the file's name, the request must include it within the Content-Disposition
in a standards-compliant manner like the following:
|
|
The above header would result in an input
object with the following files
content:
Without the header, the default filename file
(with no extension) would instead be used:
Last updated