[GeoJSON] Content-type

Nelson Minar nelson at monkey.org
Sun Nov 3 09:25:15 PST 2013


On Sun, Nov 3, 2013 at 9:01 AM, Billy Newman <newmanw10 at gmail.com> wrote:

> Is there a defined Content-Type for GeoJSON?


application/json is the correct type. In practice most anything will work,
the most important thing being that your web server knows to compress and
cache the data appropriately.

It's too bad that MIME types only describe the encoding and not the actual
contents, but that's the way the standards work. The main purpose of that
type is to signal the user agent how to decode the thing (ie: it's JSON to
turn into Javascript objects, not XML or HTML to turn into DOM or an image
or whatever.) It's up to the application to inspect the object contents to
determine what was in the JSON blob.

Speaking of which, given an arbitrary JSON object how do you tell if it's
GeoJSON? I guess looking that it has a top level "type" whose value is
"FeatureCollection"
or the like would work in practice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geojson.org/pipermail/geojson-geojson.org/attachments/20131103/a6e21157/attachment-0005.htm>


More information about the GeoJSON mailing list