Sending images to repo using API

I’m trying to send image files (.png) to a repository. I used this API method following the suggestions.

However, I get two errors:

javax.net.ssl.SSLException: Write error: ssl=0x83775000: I/O error during system call, Broken pipe

or

HTTP 400 Bad Request
Malformed request
We didn't receive a proper request from your browser. Please contact us if the problem persists.

I implemented this in Android using Kotlin. Are there some extra details about this API method? Is there a limit for the encoded file?

Turns out this was my fault regarding the request I made.