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

Re: The "new media types are evil" meme

Expand Messages
  • Jorn Wildt
    ... No, sorry, you got this wrong. Check step (3) again: The client selects a proper link from the response using link-reltypes. So the variation is on the
    Message 1 of 245 , Jan 3, 2012
    • 0 Attachment
      > > 3) The client selects a proper link from the response using link-reltypes
      > > documented in the media-type spec.
      > >
      > > 4) Client POSTs image to the selected URL.
      > >
      > > All-in-all ... the shared understanding comes from the media-type.
      > >
      >
      > OK, sounds theoretically reasonable.
      >
      > Except still being impractical. It will not be
      > "application/vnd.imageprocessor+xml"
      > , but hundreds of "application/vnd.image_blur+xml" ,
      > "application/vnd.image_crop+xml"
      > , "application/vnd.image_wavelet+xml", you name it, to represent every
      > single image processing supported.

      No, sorry, you got this wrong. Check step (3) again: "The client selects a proper link from the response using link-reltypes.

      So the variation is on the link-reltype NOT the media-type. That's very very different. There's a gazillion link-reltypes, but only a small-ish set of media-types.

      The client will POST the image as standard media-type image/png (or image/[jpg|gif|tiff|...]) - not as "application/vnd.image_blur+xml".

      The server will know what to do with the image by knowing what URL it was posted to.

      /Jørn

      --- In rest-discuss@yahoogroups.com, Nina Jeliazkova <jeliazkova.nina@...> wrote:
      >
      > On 3 January 2012 13:07, Jorn Wildt <jw@...> wrote:
      >
      > > **
      > >
      > >
      > > > The critical point is how the shared understanding between client and
      > > > server is achieved, and whether the "network-visible" semantic is
      > > > sufficient for the shared understanding.
      > >
      > > Yes.
      > >
      > >
      > > > Let's have a resource, which accepts "image/png" on POST and does
      > > > certain image processing, returning a resource URI, where the
      > > > generated image could be retrieved.
      > >
      > > > How does the client decides where to send the POST command, if it
      > > > wants a specific type of image processing? Out-of-band information
      > > > only?
      > >
      > > I would say the link-reltype that points to the page that accepts the POST.
      > >
      > > The link-reltypes would be documented in the media-type spec.
      > >
      > > It could go like this:
      > >
      > > 1) Client GETs image processing descriptor resource.
      > >
      > > 2) Server returns media-type "application/vnd.imageprocessor+xml". Now the
      > > client has a shared understanding with server about the server's
      > > capabilities.
      > >
      > > 3) The client selects a proper link from the response using link-reltypes
      > > documented in the media-type spec.
      > >
      > > 4) Client POSTs image to the selected URL.
      > >
      > > All-in-all ... the shared understanding comes from the media-type.
      > >
      >
      > OK, sounds theoretically reasonable.
      >
      > Except still being impractical. It will not be
      > "application/vnd.imageprocessor+xml"
      > , but hundreds of "application/vnd.image_blur+xml" ,
      > "application/vnd.image_crop+xml"
      > , "application/vnd.image_wavelet+xml", you name it, to represent every
      > single image processing supported.
      >
      > Nina
      >
      >
      > >
      > > /Jørn
      > >
      > >
      > >
      >
    • Peter Williams
      ... The way i read that post, message type is a way for the client to inform the server how it has decided to use a particular link. Not a way for the server
      Message 245 of 245 , Jan 12, 2012
      • 0 Attachment
        On Wed, Jan 11, 2012 at 1:44 PM, Darrel Miller <darrel.miller@...> wrote:
        > In this
        > post  http://old.nabble.com/Re%3A-Unifying---standardizing-X-Moz---X-Purpose-headers-p29794338.html%c2%a0Roy
        > talks about the notion of passive links in Waka.  Without putting works into
        > Roy's mouth, this is what I consider to be a LE.

        The way i read that post, message type is a way for the client to
        inform the server how it has decided to use a particular link. Not a
        way for the server to tell the client how it should use a particular
        link. Ie, it would be ok for a client to dereference a `img` tag link
        as an active request (or any other valid value, for that matter).

        Peter
        barelyenough.org
      Your message has been successfully submitted and would be delivered to recipients shortly.