Closed
Description
I tried to setup an endpoint for providing binary data. My main motivation is to serve images for <img>
tags without javascript. I documented my progress in a PR on the documentation repo.
There is one remaining issue. The raw-media-types
option is not powerful enough to provide a transparent binary endpoint that behaves like a webserver serving files. Firefox sends
Accept: image/webp,*/*
on <img>
requests and
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
on navigation requests (e.g. user does right click view image).
I tried the following settings:
*/*
. Navigation requests for regular json endpoints fail with*/* requested but more than one column was selected
.image/webp
. Same problem.image/*
. Does not work for<img>
requests.
From my unprivileged point of view, I see two ways forward:
- A
raw-media-endpoint
configuration option that triggers raw output for the specified tables, views, and procedures. - A local parameter
response.raw
that allows to trigger raw output for a single request with something likeperform set_config('response.raw', 'true', true);
.
The second variant can emulate the first via pre-request
. The first would suffice for my use case.