Skip to content

Query parameter for POST request #3557

Closed Answered by laurenceisla
ThuGapy asked this question in Q&A
Discussion options

You must be logged in to vote

Currently there's no way to configure which query parameters to ignore directly in PostgREST. You'll need to use a reverse proxy like Nginx to handle those query parameters. See the docs for an example on how to set Nginx for PostgREST.

In that example you can handle the query parameter at the beginning of the location definition, something like this:

location /api/ {

  # This matches any query string that ends in `event=<any_value>`
  # And replaces it with what was before that query param
  if ($args ~* "(.*)(event=.*)") {
    set $args "$1";
  }

  # The rest of the configuration ...
} 

This the simplest attempt, it can be better refined to your needs. For example, since it's appended…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ThuGapy
Comment options

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