Adding extension for attachments

OK, I'll fix that.

I added these guidelines, which the RFC alone doesn't cover.

Some key points to remember in the context of Collection+JSON:

   - For each data object in the write template there SHOULD be:
      - A separate part for the data object.
      - A content-disposition header of type form-data with a name parameter
      matching the template object name.
      - If the template data object has "attachment":"true" then the
      content-disposition header MAY contain a filename parameter.
      - If the template data object has "attachment":"true" then the body
      SHOULD contain the file contents.
      - If the template data object does not have "attachment":"true" then
      body SHOULD contain a value.


On Wed, Oct 15, 2014 at 10:02 PM, Mike Amundsen <notifications@github.com>
wrote:

> In attachment.md:
>
> > +A client MAY receive a CollectionJson document containing a Write template which accepts attachments which the client can use to send files.
> > +
> > +### Content-type property
> > +This extension defines a new optional property for the template object: `content-type`. The two valid values for `content-type ` are:
> > +
> > +* `multipart/form-data` (this is the one to use for uploading attachments)
> > +* `application/vnd.collection+json` (this is the one to use for sending regular CJ documents) If the content-type property is missing, clients SHOULD use `application/vnd.collection+json` when sending a CJ document. If the content-type property is not supported and/or the provided value is not understood by the client, the client MUST use `application/vnd.collection+json` when sending CJ documents.
> > +
> > +### Attachment property
> > +This extension defines a new property for the data object: `attachment`. This property is only valid for data objects that are children of the template object.
> > +
> > +The two valid values for the `attachment` property:
> > +
> > +* true (treat this data element as an attachment to be uploaded)
> > +* false (treat this data element as a text element) If the client does not support the `attachment` property and/or the value of this property is not understood, the client MUST treat the data element as a text element.
> > +
>
> content looks good to me. there are some typo/spelling nits: - This
> extension outlines an extension... - This extension compiles with
> RFC2388... - Receving attachments there may be others.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/collection-json/extensions/pull/7/files#r18938402>.
>