At Monite, we provide an ability for customers to upload a binary file (e.g. a payable). Currently there is no information about this. Moreover, it's possible, that we should response with a binary data, along with the text.
Proposed solution
Response can be mixed, for example
{
"files":
[
{
"base64": "",
"recognized_text": "",
"data":
{
"provider": "",
"amount": 0
}
}
]
}
Same to a payload. Instead of multipart, simple json:
{
"file_base64": "",
"account_number": "",
"lalala": ""
}
However, why use JSON instead of multipart/form-data for file + data uploads? JSON payload would be 33% bigger due to the Base64 encoding. Multipart can contain both binary files and JSON data in separate parts.
Something to discuss and decide
At Monite, we provide an ability for customers to upload a binary file (e.g. a payable). Currently there is no information about this. Moreover, it's possible, that we should response with a binary data, along with the text.
Proposed solution
Response can be mixed, for example
Same to a payload. Instead of multipart, simple json:
However, why use JSON instead of
multipart/form-datafor file + data uploads? JSON payload would be 33% bigger due to the Base64 encoding. Multipart can contain both binary files and JSON data in separate parts.Something to discuss and decide