1. Jesper Noehr
  2. django-piston
  3. Pull requests

Pull requests

#6 Open
Repository
django-piston-accept
Branch
default
Repository
django-piston
Branch
default

Using the accept header for conneg

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r default https://bitbucket.org/jbrendel/django-piston-accept
hg merge d8dcbd562c99
hg commit -m 'Merged in jbrendel/django-piston-accept (pull request #6)'
Author
  1. Juergen Brendel
Reviewers
Description

As an alternative to specifying the content type with the 'format' argument in the URI, it would be nice for a RESTful server to be able to handle the Accept header in the client request.

This patch implements a first version of this: Additional lookup dictionaries - besides EMITTERS - are used to find the emitter name based on the information provided in the Accept header.

The key is in the determine_emitter() function, which now does not just look for 'emitter_format' or 'format' in the URI, but (if those are not present) takes one more look at the Accept header of the request to see if something useful can be found there.

  • Learn about pull requests

Comments (0)