我正在寻找一种设置couchdb响应的
我已经使用
如何做到这一点? POST
CouchDB版本:1.6.1
Content-Type
的方法。我已经使用
application/json
作为Content-Type
和Accept
请求标头,以POST
方式发送了JSON。但是当我调用该文档的GET
时,它返回带有text/plain; charset=utf-8
的Content-Type
的JSON响应。我期望得到的是application/json
作为它的Content-Type
。如何做到这一点? POST
- URL : http://localhost:5984/hotel_staticdata
- 请求正文:
{"_id":"test-hotel-stat-data","content":[{"hotelcode": "AMB3_LON","hotelname": "Ambassadors Bloomsbury"},{"hotelcode": "ALE1_LON","hotelname": "Alexandra"},{"hotelcode": "ALE1_LON","hotelname": "Alexandra"}]}
- 请求标头: Accept : application/json Content-Type : application/json
- URL : http://localhost:5984/hotel_staticdata/test-hotel-stat-data
- 响应正文:
{"_id":"test-hotel-stat-data","_rev":"3-6c6e26cd5690794886a8dc65308bf078","content":[{"hotelcode":"AMB3_LON","hotelname":"Ambassadors Bloomsbury"},{"hotelcode":"ALE1_LON","hotelname":"Alexandra"},{"hotelcode":"ALE1_LON","hotelname":"Alexandra"}]}
- 响应标头: Content-Length : 249 Content-Type : text/plain; charset=utf-8
CouchDB版本:1.6.1