A while ago I wrote a "web service" of sorts that seems to be something like what's described in the article. It consisted of a cgi script that when asked to do stuff, did it, and returned plain text (Content-type: text/plain). URLs looked like: https://.../foo.pl?do=something&arg1=bar&arg2=baz ('...' replaced by the actual domain). If you asked it for a list of something, results were returned as one item per line. If you asked it to *do* something, it usually returned "OK" or "ERROR".

So, that's all there was. Everything was a GET, the base URL was always the same (just a path to the cgi script, and no equals sign in the path or anything like that), and it was only really used by a dedicated client app -- though you could access it from a browser too, if you cared to (mostly for testing purposes). The client provided the user interface and talked to the cgi script behind the scenes.

Was my method inferior? Everything worked like it was supposed to. In what ways is official "REST" better?


In reply to Re: Developing RESTful Web Services in Perl by bramble
in thread Developing RESTful Web Services in Perl by derby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.