Skip to content

RPC text/javascript result Content-Type question #3387

Answered by steve-chavez
mkleczek asked this question in Q&A
Discussion options

You must be logged in to vote

If the browser sends */*, you need to use the any handler. Otherwise postgREST will use the default application/json handler (which does json_agg underlyingly). You'll manually have to set the "text/javascript" with set_config('response.headers'.

This is a limitation of the design of custom media type handlers. There are more flexible alternatives (like #3037), which could come in the future. For now you'll have to use the any handler workaround.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@mkleczek
Comment options

@wolfgangwalther
Comment options

@mkleczek
Comment options

Comment options

You must be logged in to vote
3 replies
@steve-chavez
Comment options

@wolfgangwalther
Comment options

@mkleczek
Comment options

Answer selected by mkleczek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants