Tim Bray wrote:
> I'm in favor of simplification, but there's one scenario that seems
> harder to me without media collections.  Suppose I'm a cameraphone.  I
> want to create a post containing one picture and a few words wrapped
> around that.  How do I do that using APP?


One of two ways.

1.
  POST /entry-collection-uri HTTP/1.1
  Host: example.org
  Content-Type: image/jpeg
  Content-Length: nnnn
  Title: My Trip To Torino
  Content-Description: Shaun White laying down massive airs
  Content-Disposition: attachment; filename=shaun_airs.jpg

  {binary data}


  HTTP/1.1 201 Created
  Date: nnnn
  Location: http://example.org/entries/1


  GET /entries/1

    (returns)

  <entry>
    <id>...</id>
    <title>My Trip To Torino</title>
    <summary>Shaun White laying down massive airs</summary>
    <updated>...</updated>
    <author><name>jasnell</name></author>
    <content type="image/jpeg"
             src="http://example.org/photos/shaun_airs.jpg"; />
  </entry>

Or

2.
  POST /entry-collection-uri HTTP/1.1
  Host: example.org
  Content-Type: multipart/related; type=application/atom+xml; ...
  Content-Length: nnnn

  --MIME_Boundary
  Content-Type: application/atom+xml
  Content-ID: ....
  Content-Length: nnnn

  <entry>
    <id>...</id>
    <title>My Trip To Torino</title>
    <summary>Shaun White laying down massive airs</summary>
    <updated>...</updated>
    <author><name>James</name></author>
    <content type="xhtml">
      <div>
        <img src="cid:thephoto" />
      </div>
    </content>
  </entry>

  --MIME_Boundary
  File-Transfer-Encoding: binary
  Content-Type: image/jpeg
  Content-ID: <thephoto>
  Content-Length: nnnn
  Content-Disposition: attachment; filename=shaun_airs.jpg

  {binary data}


  HTTP/1.1 201 Created
  Date: nnnn
  Location: http://example.org/entries/1


  GET /entries/1

    (returns)

  <entry>
    <id>...</id>
    <title>My Trip To Torino</title>
    <summary>Shaun White laying down massive airs</summary>
    <updated>...</updated>
    <author><name>jasnell</name></author>
    <content type="image/jpeg"
             src="http://example.org/photos/shaun_airs.jpg"; />
  </entry>


Reply via email to