Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-463

Allow client to insist on Content-Type: application/json in all responses

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • HTTP Interface
    • None
    • Regular Contributors Level (Easy to Medium)

    Description

      The Content-Type of responses is negotiated via Accept (application/json if acceptable, text/plain if not). When the client is the browser, this often fails as the Accept line usually does not include application/json.

      Consider a query parameter to force application/json responses even without the Accept header. Couchdb-lucene does this today (it didn't do it yesterday), described as;

      "force_json
      Usually couchdb-lucene determines the Content-Type of its response based on the presence of the Accept header. If Accept contains "application/json", you get "application/json" in the response, otherwise you get "text/plain;charset=utf8". Some tools, like JSONView for FireFox, do not send the Accept header but do render "application/json" responses if received. Setting force_json=true forces all response to "application/json" regardless of the Accept header."

      I recognize it duplicates the HTTP content negotiation.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rnewson Robert Newson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: