[Developers] mqlread http response header (content-type)

Augusto Callejas acallejas at appliedminds.com
Wed Sep 17 16:36:56 UTC 2008


hi-

when i perform a mqlread query, i get back HTTP response headers that look
like:

=====
Date: Wed, 17 Sep 2008 00:51:35 GMT
,
Server: Apache
,
X-Metaweb-Success: 1/1
,
Content-Length: 35616
,
Content-Type: text/plain; charset="utf-8"
,
...
Connection: Keep-Alive
=====


shouldn't the "Content-Type" header value be "application/json"?

 http://www.iana.org/assignments/media-types/application/

i'm having a problem with the 'charset="utf-8"' in the header.
the java http client library that i'm using (
http://hc.apache.org/httpclient-3.x/) reads the response (see example
below), and decodes any unicode characters (ie. /u001a) into their actual
character value.  however, this is before i get a chance to decode it in my
json library.  however, the unicode characters have already been decoded at
the http level, but not at the json level.

any thoughts?

thanks,
augusto.


query
=====
{"q":{"query":
{
  "master_property" : "/type/object/name",
  "operation" : "delete",
  "source" : {
    "guid" : "#9202a8c04000641f8000000006e31736"
  },
  "target_value" : {
    "value" : null
  },
  "timestamp" : "2008-08-30T18:56:23.0000Z",
  "type" : "/type/link",
  "valid" : null
}
}}
=====


response
=====
{
  "master_property" : "/type/object/name",
  "operation" : "delete",
  "source" : {
    "guid" : "#9202a8c04000641f8000000006e31736"
  },
  "target_value" : {
    "value" : "Friesengeist 2: Regelm\u001aässige Zerstö\u001arungen"
  },
  "timestamp" : "2008-08-30T18:56:23.0000Z",
  "type" : "/type/link",
  "valid" : null
}
=====




More information about the Developers mailing list