gdoteof / election

drupal election module
3 stars 1 forks source link

Use 'application/json' Content Type for JSON Representations #1

Closed bradley-holt closed 12 years ago

bradley-holt commented 12 years ago

Description

The content type for JSON representations should be application/json, not text/json.

Steps to Reproduce

curl -iX GET 'https://example.org/town-meeting-season-2011' \
-H 'Accept: application/json'

Actual Results

HTTP/1.1 200 OK
…
Content-Type: text/json

Expected Results

HTTP/1.1 200 OK
…
Content-Type: application/json

Additional Comments

According to RFC 4627:

The MIME media type for JSON text is application/json.

acrawford commented 12 years ago

Geoff, make sure I didn't clobber anything in the election repo. It looks fine, but I had to mess with my git config to make this commit. The latest is also live on dev via bazaar, and I can confirm it works there: Request: link https://dev.cctv.org/cctv.org/e/town-meeting-season-2011/town-meeting-day-2011/city-of-burlington Response Headers: Status Code: 200 Date: Tue, 24 Jan 2012 14:45:23 GMT X-Powered-By: ################ Connection: Keep-Alive Content-Length: 4236 Last-Modified: Tue, 24 Jan 2012 09:45:24 -0500 Server: ################### Content-Type: application/json Cache-Control: store, no-cache, must-revalidate, post-check=0, pre-check=0 Keep-Alive: timeout=15, max=100 Expires: Tue, 24 Jan 2012 09:45:24 -0500

bradley-holt commented 12 years ago

Works for me now—thanks!