You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Alexander Shorin (JIRA)" <ji...@apache.org> on 2015/04/27 17:58:39 UTC

[jira] [Closed] (COUCHDB-2676) DELETE of a database returns JSON answer with type text/plain

     [ https://issues.apache.org/jira/browse/COUCHDB-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Shorin closed COUCHDB-2676.
-------------------------------------
    Resolution: Not A Problem

It's a content type negotiation where for {{Accept: */*}} text/plain is preferred in the way to make API be friendly for the browsers.

{code}
http delete http://localhost:5984/test 'Accept:application/json'
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 12
Content-Type: application/json
Date: Mon, 27 Apr 2015 15:56:00 GMT
Server: CouchDB/1.6.1 (Erlang OTP/17)

{
    "ok": true
}

{code}

If you explicitly ask for application/json response - you'll get it. Same is true for the most of other endpoints. Search for "content negotiation" on JIRA for more info about that behaviour.

> DELETE of a database returns JSON answer with type text/plain
> -------------------------------------------------------------
>
>                 Key: COUCHDB-2676
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2676
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: HTTP Interface
>    Affects Versions: 1.6.1
>            Reporter: Samuel Tardieu
>
> DELETE should return its response with a "application/json" MIME type.
> {code}
> % curl -v -X DELETE http://localhost:5984/test 
> *   Trying ::1...
> * Connected to localhost (::1) port 5984 (#0)
> > DELETE /test HTTP/1.1
> > Host: localhost:5984
> > User-Agent: curl/7.42.0
> > Accept: */*
> > 
> < HTTP/1.1 200 OK
> < Server: CouchDB/1.6.1 (Erlang OTP/17)
> < Date: Mon, 27 Apr 2015 15:30:14 GMT
> < Content-Type: text/plain; charset=utf-8
> < Content-Length: 12
> < Cache-Control: must-revalidate
> < 
> {"ok":true}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)