Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Is REST best?

by sundialsvc4 (Abbot)
on Jul 12, 2014 at 00:40 UTC ( [id://1093330]=note: print w/replies, xml ) Need Help??


in reply to Is REST best?

REST isn’t my personal favorite, partly because I really don’t want to put things in a URL-string that is so easily manipulated ... unless it actually makes sense (and is possible) for the user to reasonably specify a RESTful URL-string entirely on his own.   (Or when it is both meaningful and harmless for me to build clickable hyperlinks.)   Otherwise, I tend to define a single /api entry-point and to use JSON in both directions.   The API simply implements a remote-procedure-call type of interface, and the URL-string means nothing.

A good example where REST might make perfect sense is in, say, a list of songs on a music site.   In that case, a URL-string of /song/nnnn, where nnnn is a song-number, might be just what the doc ordered.   But if it is strictly meant to be a program-to-program interface, I don’t ordinarily choose that route.

Replies are listed 'Best First'.
Re^2: Is REST best?
by perlfan (Vicar) on Jul 12, 2014 at 03:12 UTC
    RESTful URLs are minimal. Query strings are discouraged, and most data is passed in the request in some serialized format. Couple this with the HTTP method and you get a much easier to maintain dispatching situation on the server. Sanitizing what is in any request you send is just part of the deal, it doesn't matter if it's in the URL or not. So I am not sure I get your issue.

      So I am not sure I get your issue.

      sundialsvc4 is the biggest troll on perlmonks, thats about the sum of it

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found