Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Complex filter queries in a REST API

by bliako (Monsignor)
on Mar 25, 2021 at 15:08 UTC ( [id://11130326]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Complex filter queries in a REST API
in thread Complex filter queries in a REST API

Good point, but JSON can be sent also by GET (URI encoded and paying attention to the max length). On the other hand, sending JSON can confuse or blind server-side caching if you ever need this with live-db queries.

  • Comment on Re^3: Complex filter queries in a REST API

Replies are listed 'Best First'.
Re^4: Complex filter queries in a REST API
by martell (Hermit) on Mar 26, 2021 at 11:29 UTC

    Thanks for this suggestion. I was clearly overthinking the situation.

    I need to comply to the REST style and must use a GET request, but my cases are small enough that using a JSON string should be possible. And SQL abstract is already familiar, so implementation should not be an issue. I will test this approach.

    Kind regards

      Just to clarify (and to others): I merely said that *I* use POST. Nothing stops you using GET+JSON but the max URI length.

      In my first post I deleted accidentally a serious caveat: that with a SQL::Abstract-style query you are exposing the structure of your DB to the client unless you alias field and table names.

      bw, bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130326]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-23 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found