Created
January 12, 2015 15:15
-
-
Save fawcett/65b0ce0325165ff6785d to your computer and use it in GitHub Desktop.
Post Problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can see the results of the requests at requestb.in | |
# The older request fails and the newer request works (when sent to geocoder) | |
# http://requestb.in/x90623x9?inspect | |
#This data payload does not work | |
addrPayload = {"records": [{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}}]} | |
#this data payload does work | |
addrPayload = {"records": [{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}},{"attributes": {"STREET": "360 Sherman St Ste 300", "ZIP": "55102", "OBJECTID": 468}}]} | |
# function doing request | |
def geocodeAddressEsriRest(addressPkg,geocoderUri): | |
payload = json.dumps(addressPkg) | |
r = requests.post(geocoderUri, params={"addresses":payload, "f":"json", "outSR":4326}) | |
return json.loads(r.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment