[REST] fix headersonly flag for BINARY responses / overhaul format handling

Don't indent cases please.