Skip to content

Commit

Permalink
adding content_type to forms as placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
tef committed Aug 9, 2012
1 parent 197f7fe commit aa65a8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions doc/todo
Expand Up @@ -15,9 +15,11 @@ next commits:
decimal floats, ordered dictionaries for form arms,
non post handling for forms,
placeholders for headers, envelopes
node removal
todo:
headers in forms, links
form envelope types
PUT, DELETE, PATCH in forms.

post spec 1.0 python refactor?

Expand All @@ -37,6 +39,7 @@ next commits:
done: avoid to_sym
done: better ordered dictionaries
done: decimal floats
done: node removal

todo: relative url handling
todo: form input support, names and values
Expand Down
26 changes: 15 additions & 11 deletions spec/glyph_spec.rst
Expand Up @@ -401,6 +401,10 @@ forms make unsafe requests.

- a unicode string, describing how to construct a request

* MAY have the key 'content_type'

- if present, MUST be the glyph mime type.

- content is nil object

forms normally describe a POST request, under http. forms SHOULD be
Expand Down Expand Up @@ -650,11 +654,6 @@ forms and links MAY provide the following headers in requests:
- forms can have the headers 'If-None-Match', 'Accept', 'If-Match', 'If-Unmodified-Since', 'If-Modified-Since'
- links can have the headers 'Accept'

if the request data is a single 'blob' object, the client MAY send the blob contents
as the request body, setting the appropriate content-type header.

servers SHOULD handle arbitrary request data as if it were a single 'blob' object.

servers SHOULD support HEAD requests, and MAY support OPTIONS requests.

responses
Expand Down Expand Up @@ -682,10 +681,14 @@ http response, using the content-type attribute.

glyph responses MAY use relative urls.

the methods `OPTIONS`, `TRACE`, `HEAD` are not used.

links
-----

links MUST always be safe, idempotent requests.
links MUST always be safe, idempotent requests. the methods
`PUT`, `POST`, `DELETE`, `PATCH`, are not valid.


if the method is not present, it is assumed to be 'GET'.

Expand All @@ -704,7 +707,9 @@ for 'none', the request MUST have no body, and the form MUST NOT have arguments.
if arguments are present, clients SHOULD raise an error.

for 'blob', the client MUST send the blob contents as the request body,
setting the appropriate content-type header.
setting the appropriate content-type header. The client
MUST add the header 'Content-Disposition: form-data; name="...";',
with the name of the input set.

for 'form', the request body MUST be a glyph encoded ordered
dictionary of (name->value) entries.
Expand Down Expand Up @@ -1057,15 +1062,13 @@ before embracing hypermedia.

- removed non http method support.

- added content-type to forms

planned changes
---------------


- 0.9 extensions frozen, http mapping frozen
envelopes on inputs?
i.e the blob/query case
www-data on forms? www-query
remove non http method support (or make it less obvious)


- 1.0 compatibility promise
Expand All @@ -1074,6 +1077,7 @@ planned changes
- 1.1

add paginated collection extension
envelope: mixed; allow envelope on form inputs
types for form inputs
envelopes: url templates?
canonical html/json serialization,
Expand Down

0 comments on commit aa65a8a

Please sign in to comment.