Beispiel: JSON GET-Anforderung und -Antwort

Im Folgenden wird ein Beispiel für eine JSON GET-Anforderung an den Reverse Geocode-Dienst aufgeführt. Beachten Sie, dass ein Wert, der mit mehr als einem Schlüsselabfrageparameter verbunden ist, den Parametern unter Verwendung der folgenden Syntax zugewiesen werden kann: parameter1&parameter2=value.

GET http://myserver:8080/rest/GlobalGeocode/reverseGeocode.json?
x=57.70716&y=12.025594&coordSysName=EPSG:4326&
distance=1&distanceUnits=METERS HTTP/1.1

Nachfolgend wird die JSON-Antwort dargestellt, die von der vorherigen Anforderung zurückgegeben wurde.

{
   "totalPossibleCandidates": 1,
   "totalMatches": 1,
   "candidates": [
      {
         "precisionLevel": 1,
         "formattedStreetAddress": "KALLKÄLLEGATAN 34",
         "formattedLocationAddress": "416 54 GÖTEBORG",
         "identifier": null,
         "precisionCode": "RS5A",
         "sourceDictionary": "0",
         "matching": null,
         "geometry": {
            "type": "Point",
            "coordinates": [
               57.712566, 12.025625
            ],
            "crs": {
               "type": "name",
               "properties": {
                  "name": "epsg:4326"
               }
            }
         },
         "address": {
            "mainAddressLine": "KALLKÄLLEGATAN 34",
            "addressLastLine": "416 54 GÖTEBORG",
            "placeName": "",
            "areaName1": "VÄSTRA GÖTALANDS LÄN",
            "areaName2": "GÖTEBORG",
            "areaName3": "GÖTEBORG",
            "areaName4": "",
            "postCode1": "416 54",
            "postCode2": "",
            "country": "SWE",
            "addressNumber": "34",
            "streetName": "KALLKÄLLE",
            "unitType": null,
            "unitValue": null,
            "customFields": {
               "REVERSE_GEOCODE_DISTANCE_UNIT": "METER",
               "REVERSE_GEOCODE_DISTANCE": "0.9420000000000001"
            }
         },
         "ranges": [
            {
               "placeName": null,
               "lowHouse": "34",
               "highHouse": "34",
               "side": "UNKNOWN",
               "oddEvenIndicator": "EVEN",
               "units": [],
               "customValues": {}
            }
         ]
      }
   ]
}