Files

The possible formats are listed here, but which of those are allowed may vary from network to network.

Sending and Receiving

Files will usually be a field or a list of fields on a resource. When requesting such a resource, the file will be represented by a link to the file itself:

GET /question/42
{
    ...
    "avatar": "/avatar/a2/f72e155fb8957e0d3a855e27b3f91e.jpg",
    ...
}

When receiving files, we expect them to be base64 encoded, according to RFC4648, like this:

PUT /question/42
{
    "avatar": "WFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ..."
}