Changeset 175:9e9871398c7f

Show
Ignore:
Timestamp:
08/28/08 21:16:15 (2 years ago)
Author:
rgrp
Branch:
default
convert_revision:
svn:10edda23-d834-0410-9182-b00384516d49/trunk@187
Message:

[rest][xs]: change rest api to set content-type header to application/json.

This is a minor change but without it ajaxy interaction with server on www.microfacts.org was failing (it seems returned json data was simply not getting processed by mootools JSON request object). Not clear why this was working on localhost but not on remote hosts but it is fixed now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • microfacts/controllers/rest.py

    r68 r175  
    7373 
    7474    def finish(self): 
     75        response.headers['Content-type'] = 'application/json' 
    7576        response.status_code = self.mode.response_code 
    7677        return simplejson.dumps(self.mode.response_data)