Adding extension for attachments

i think something odd is going on here. why return a collection as
mixedpart at all? what problem is this solving that isn't covered by link
elements w/ a render value?


On Sun, Oct 12, 2014 at 2:04 PM, Glenn Block <notifications@github.com>
wrote:

> In attachment.md:
>
> > +--AaB03x
> > +content-disposition: form-data; name="full-name"
> > +content-type: text/plain; charset=us-ascii
> > +John Doe
> > +--AaB03x
> > +content-disposition: form-data; name="email"
> > +content-type: text/plain; charset=us-ascii
> > +jdoe@example.org
> > +--AaB03x
> > +content-disposition: form-data; name="avatar"
> > +content-type: image/jpeg
> > +...
> > +--AaB03x
> > +```
> > +## Receving attachments
> > +A client may also receive a response that contains attachments. In these cases the response media type will be "multipart/mixed" containing parts for a collection+json document as well as attachments.
>
> OK, so how about this?
>
>    - If the client sends an accept of "multipart/mixed" they get the
>    multipart response.
>    - Otherwise the client gets a collection+json response. Looking
>    through the response they will be able to tell that there are attachments
>    by identifying the "attachment" fields.
>
> For the non multipart response, another option is to have a link or
> something at the doc level that indicates it has attachments.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/collection-json/extensions/pull/7/files#r18748954>.
>