Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing guidance on uploading binary files #2

Open
a-akimov opened this issue Oct 2, 2022 · 0 comments
Open

Missing guidance on uploading binary files #2

a-akimov opened this issue Oct 2, 2022 · 0 comments

Comments

@a-akimov
Copy link
Member

a-akimov commented Oct 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant