Loading ...
Sorry, an error occurred while loading the content.

Re: [rest-discuss] Write-only resources

Expand Messages
  • mike amundsen
    I usually define a resource URL that allows POST (/postable/) that writes data to the server (file- or data-store) and then define another resource URL that
    Message 1 of 4 , Feb 10, 2008
    • 0 Attachment
      I usually define a resource URL that allows POST (/postable/) that
      writes data to the server (file- or data-store) and then define
      another resource URL that allows reading that same data from the
      server.

      So it looks like this:
      POST /postable/ (response 204)

      Then later:
      GET /recent-posts/ (returns list of items recently posted to /postable/)

      Often I set rights on the /postable/ URL to POST=true and
      GET,HEAD,PUT,DELETE=false. The /recent-posts/ URL might be accessible
      only by admins or other higher-level users.

      Hope this helps.

      Mike A

      On Feb 10, 2008 8:29 PM, Ebenezer Ikonne <amaeze@...> wrote:
      > Does anyone see issues with exposing a resource as write-only? If a
      > resource is write-only, should the design be revisited? I read
      > somewhere that its good design to make all resources at least "read-
      > able", so if HTTP is the protocol of choice, the resource needs to be
      > GET'able.
      >
      > Any thoughts?
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >



      --
      mca
      http://amundsen.com/blog/
    • Ebenezer Ikonne
      It helps in that you re thinking what I m thinking. :) Thanks. ... to /postable/) ... accessible ... If a ... least read- ... to be
      Message 2 of 4 , Feb 10, 2008
      • 0 Attachment
        It helps in that you're thinking what I'm thinking. :)

        Thanks.

        --- In rest-discuss@yahoogroups.com, "mike amundsen" <mamund@...>
        wrote:
        >
        > I usually define a resource URL that allows POST (/postable/) that
        > writes data to the server (file- or data-store) and then define
        > another resource URL that allows reading that same data from the
        > server.
        >
        > So it looks like this:
        > POST /postable/ (response 204)
        >
        > Then later:
        > GET /recent-posts/ (returns list of items recently posted
        to /postable/)
        >
        > Often I set rights on the /postable/ URL to POST=true and
        > GET,HEAD,PUT,DELETE=false. The /recent-posts/ URL might be
        accessible
        > only by admins or other higher-level users.
        >
        > Hope this helps.
        >
        > Mike A
        >
        > On Feb 10, 2008 8:29 PM, Ebenezer Ikonne <amaeze@...> wrote:
        > > Does anyone see issues with exposing a resource as write-only?
        If a
        > > resource is write-only, should the design be revisited? I read
        > > somewhere that its good design to make all resources at
        least "read-
        > > able", so if HTTP is the protocol of choice, the resource needs
        to be
        > > GET'able.
        > >
        > > Any thoughts?
        > >
        > >
        > >
        > >
        > >
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        >
        >
        >
        > --
        > mca
        > http://amundsen.com/blog/
        >
      • mike amundsen
        [great minds think alike, eh ] I use a similar pattern for handling comments and emails back to me. I expose a POST-only URL and handle the details on the
        Message 3 of 4 , Feb 10, 2008
        • 0 Attachment
          [great minds think alike, eh<grin>]

          I use a similar pattern for handling comments and emails back to me. I
          expose a POST-only URL and handle the details on the server side.

          Mike A

          On Feb 10, 2008 9:28 PM, Ebenezer Ikonne <amaeze@...> wrote:
          > It helps in that you're thinking what I'm thinking. :)
          >
          > Thanks.
          >
          > --- In rest-discuss@yahoogroups.com, "mike amundsen" <mamund@...>
          > wrote:
          > >
          > > I usually define a resource URL that allows POST (/postable/) that
          > > writes data to the server (file- or data-store) and then define
          > > another resource URL that allows reading that same data from the
          > > server.
          > >
          > > So it looks like this:
          > > POST /postable/ (response 204)
          > >
          > > Then later:
          > > GET /recent-posts/ (returns list of items recently posted
          > to /postable/)
          > >
          > > Often I set rights on the /postable/ URL to POST=true and
          > > GET,HEAD,PUT,DELETE=false. The /recent-posts/ URL might be
          > accessible
          > > only by admins or other higher-level users.
          > >
          > > Hope this helps.
          > >
          > > Mike A
          > >
          > > On Feb 10, 2008 8:29 PM, Ebenezer Ikonne <amaeze@...> wrote:
          > > > Does anyone see issues with exposing a resource as write-only?
          > If a
          > > > resource is write-only, should the design be revisited? I read
          > > > somewhere that its good design to make all resources at
          > least "read-
          > > > able", so if HTTP is the protocol of choice, the resource needs
          > to be
          > > > GET'able.
          > > >
          > > > Any thoughts?
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > > > Yahoo! Groups Links
          > > >
          > > >
          > > >
          > > >
          > >
          > >
          > >
          >
          > > --
          > > mca
          > > http://amundsen.com/blog/
          > >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >



          --
          mca
          http://amundsen.com/blog/
        Your message has been successfully submitted and would be delivered to recipients shortly.