MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Codebase Pot Pie - Or what I like or wish I could have

    MU Code
    7
    26
    5618
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ixokai last edited by

      Rhost's API is HTTP based but not RESTful.

      Rhost listens on a separate API port. You connect to that port, authenticating with a dbref and a password. (This password is NOT the login password but is set with @api/password obj=pw) via Basic HTTP authentication.

      The dbref must have the API @power.

      The API is entirely header based. If you do a GET request, the 'Exec' header evaluates code as that dbref and returns its result. If you do a POST request, the 'Exec' header is a series of commands that are run. Basically, GET is like u() and POST is like @tri.

      There's some other details: POST can have a Time header which will delay the commands that long. GET can have a Parse header which will determine if it evaluates the code as normal, only as substitutions, or ansi, and some other options. It can also have an Encode header to return the content in base64.

      This basically allows you to execute arbitrary code / responses in the MUSH from external scripts. And with the execscript() function you can execute external scripts from within the game.

      I haven't used it a lot yet, but one way I do use it is before I would have a timer on my game to dump a flatfile every so file. Now, my backup script (run by linux's cron) uses the API to @dump/flat before it runs.

      faraday 1 Reply Last reply Reply Quote 0
      • faraday
        faraday @ixokai last edited by

        @ixokai said in Codebase Pot Pie - Or what I like or wish I could have:

        Rhost's API is HTTP based but not RESTful.

        I'm confused. Didn't @Ashen-Shugar announce it by saying:

        "Rhost's RESTapi is effectively completed and live."

        Ashen-Shugar I 2 Replies Last reply Reply Quote 0
        • Ashen-Shugar
          Ashen-Shugar @faraday last edited by

          @faraday said in Codebase Pot Pie - Or what I like or wish I could have:

          @ixokai said in Codebase Pot Pie - Or what I like or wish I could have:

          Rhost's API is HTTP based but not RESTful.

          I'm confused. Didn't @Ashen-Shugar announce it by saying:

          "Rhost's RESTapi is effectively completed and live."

          It's 'psudo restful'.

          It essentially uses all header-driven queries to push and pull data from the engine.

          I could make it fully restful, but having full pathing in an http request didn't make much sense for a mush distribution, and honestly headers works quite nicely.

          faraday 1 Reply Last reply Reply Quote 0
          • I
            ixokai @faraday last edited by

            @faraday

            I'd call it inspired (more STEP then REST), but really, the API is not in any meaningful way RESTful.

            A RESTful API would be like GET http://whatever/object/attribute and PUSH http://whatever/object and ...etc. This is more low level then that. There's no URL routing like you'd expect from a REST api.

            I think Ash might have misspoken because his job experience isn't really in the realm of REST.

            Its a HTTP header-based API that's capable of doing almost anything but it does so by remotely accepting commands or functions to evaluate (and return data from).

            1 Reply Last reply Reply Quote 0
            • faraday
              faraday @Ashen-Shugar last edited by

              @Ashen-Shugar said in Codebase Pot Pie - Or what I like or wish I could have:

              It's 'psudo restful'.

              It seems to be a perfectly fine API, but as @ixokai says, it's really "not in any meaningful way RESTful". Using REST when describing it is wildly misleading.

              Anyway, @Ghost - ignore the links I shared; they've got nothing whatsoever to do with the RHost API.

              1 Reply Last reply Reply Quote 0
              • Chet
                Chet Banned last edited by

                We need open source code to make coding easier, like a MUSH version of Windows.

                j/k

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 2 / 2
                • First post
                  Last post