fixed incorrect content-type being sent

safe_urlopen uses urllib2 which sets the content-type to application/x-www-form-urlencoded by default. We are sending json encoded data, and so have to override the headers.