diff --git a/_includes/rest/analytics.md b/_includes/rest/analytics.md index 1158ab46..3d71fb70 100644 --- a/_includes/rest/analytics.md +++ b/_includes/rest/analytics.md @@ -34,17 +34,19 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/events/AppOpened

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/events/AppOpened', json.dumps({
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/events/AppOpened', '', {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -73,22 +75,25 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/events/Search

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/events/Search', json.dumps({
-       "dimensions": {
-         "priceRange": "1000-1500",
-         "source": "craigslist",
-         "dayType": "weekday"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "dimensions": {
+        "priceRange": "1000-1500",
+        "source": "craigslist",
+        "dayType": "weekday"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -108,20 +113,23 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/events/Error

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/events/Error', json.dumps({
-       "dimensions": {
-         "code": "404"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "dimensions": {
+        "code": "404"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/cloud-code.md b/_includes/rest/cloud-code.md index 6ef8b69c..5c498d8b 100644 --- a/_includes/rest/cloud-code.md +++ b/_includes/rest/cloud-code.md @@ -15,17 +15,19 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/functions/hello

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/functions/hello', json.dumps({
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/functions/hello', '', {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -47,17 +49,20 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/jobs/userMigration

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/jobs/userMigration', json.dumps({
-       "plan": "paid"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "plan": "paid"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/config.md b/_includes/rest/config.md index 29587462..4f682f21 100644 --- a/_includes/rest/config.md +++ b/_includes/rest/config.md @@ -14,15 +14,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/config

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/config', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/files.md b/_includes/rest/files.md index 1022ed7b..5bfc88eb 100644 --- a/_includes/rest/files.md +++ b/_includes/rest/files.md @@ -14,16 +14,19 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/files/hello.txt

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/files/hello.txt', 'Hello, World!', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "text/plain"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "text/plain"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -55,16 +58,19 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/files/pic.jpg

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/files/pic.jpg', open('myPicture.jpg', 'rb').read(), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "image/jpeg"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "image/jpeg"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -89,23 +95,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/classes/PlayerProfile

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/classes/PlayerProfile', json.dumps({
-       "name": "Andrew",
-       "picture": {
-         "name": "...profile.png",
-         "url:": "...profile.png",
-         "__type": "File"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "name": "Andrew",
+    "picture": {
+        "name": "...profile.png",
+        "url:": "...profile.png",
+        "__type": "File"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -124,15 +133,18 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/files/...profile.png

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/files/...profile.png', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/geopoints.md b/_includes/rest/geopoints.md index 18addebf..ff9ca70f 100644 --- a/_includes/rest/geopoints.md +++ b/_includes/rest/geopoints.md @@ -22,22 +22,25 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/classes/PlaceObject

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/classes/PlaceObject', json.dumps({
-       "location": {
-         "__type": "GeoPoint",
-         "latitude": 40.0,
-         "longitude": -30.0
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "location": {
+        "__type": "GeoPoint",
+        "latitude": 40.0,
+        "longitude": -30.0
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -64,24 +67,28 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/PlaceObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"limit":10,"where":json.dumps({
-       "location": {
-         "$nearSphere": {
-           "__type": "GeoPoint",
-           "latitude": 30.0,
-           "longitude": -20.0
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"limit": 10, "where": json.dumps({
+    "location": {
+        "$nearSphere": {
+            "__type": "GeoPoint",
+            "latitude": 30.0,
+            "longitude": -20.0
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/PlaceObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -135,25 +142,29 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/PlaceObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "location": {
-         "$nearSphere": {
-           "__type": "GeoPoint",
-           "latitude": 30.0,
-           "longitude": -20.0
-         },
-         "$maxDistanceInMiles": 10.0
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "location": {
+        "$nearSphere": {
+            "__type": "GeoPoint",
+            "latitude": 30.0,
+            "longitude": -20.0
+        },
+        "$maxDistanceInMiles": 10.0
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/PlaceObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -186,33 +197,37 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/PizzaPlaceObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "location": {
-         "$within": {
-           "$box": [
-             {
-               "__type": "GeoPoint",
-               "latitude": 37.71,
-               "longitude": -122.53
-             },
-             {
-               "__type": "GeoPoint",
-               "latitude": 30.82,
-               "longitude": -122.37
-             }
-           ]
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "location": {
+        "$within": {
+            "$box": [
+                {
+                    "__type": "GeoPoint",
+                    "latitude": 37.71,
+                    "longitude": -122.53
+                },
+                {
+                    "__type": "GeoPoint",
+                    "latitude": 30.82,
+                    "longitude": -122.37
+                }
+            ]
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/PizzaPlaceObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -252,38 +267,42 @@ curl -X GET \ https://api.parse.com/1/classes/PizzaPlaceObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('api.parse.com', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "location": {
-         "$geoWithin": {
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('api.parse.com', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "location": {
+        "$geoWithin": {
             "$polygon": [
-              {
-                "__type": "GeoPoint",
-                "latitude": 25.774,
-                "longitude": -80.190
-              },
-              {
-                "__type": "GeoPoint",
-                "latitude": 18.466,
-                "longitude": -66.118
-              },
-              {
-                "__type": "GeoPoint",
-                "latitude": 32.321,
-                "longitude": -64.757
-              }
+                {
+                    "__type": "GeoPoint",
+                    "latitude": 25.774,
+                    "longitude": -80.190
+                },
+                {
+                    "__type": "GeoPoint",
+                    "latitude": 18.466,
+                    "longitude": -66.118
+                },
+                {
+                    "__type": "GeoPoint",
+                    "latitude": 32.321,
+                    "longitude": -64.757
+                }
             ]
-          }
-       }
-     })})
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/1/classes/PizzaPlaceObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/hooks.md b/_includes/rest/hooks.md index 0db8f4a3..219c7129 100644 --- a/_includes/rest/hooks.md +++ b/_includes/rest/hooks.md @@ -60,16 +60,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/hooks/functions', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -97,16 +100,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions/sendMessage

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/hooks/functions/sendMessage', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -133,16 +139,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/hooks/triggers', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -178,16 +187,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers/Scores/beforeSave

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/hooks/triggers/Scores/beforeSave', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -238,18 +250,22 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/hooks/functions', json.dumps(
-       {"functionName":"baz","url":"https://api.example.com/baz"}
-     ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/hooks/functions', json.dumps({
+    "functionName": "baz",
+    "url": "https://api.example.com/baz"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -275,18 +291,22 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/hooks/functions', json.dumps(
-       {"functionName":"bar","url":"https://api.example.com/bar"}
-     ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/hooks/functions', json.dumps({
+    "functionName": "bar",
+    "url": "https://api.example.com/bar"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -324,18 +344,23 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/hooks/triggers', json.dumps(
-       {"className": "Game", "triggerName": "beforeSave", "url": "https://api.example.com/Game/beforeSave"}
-     ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/hooks/triggers', json.dumps({
+    "className": "Game",
+    "triggerName": "beforeSave",
+    "url": "https://api.example.com/Game/beforeSave"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -365,18 +390,23 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('POST', '/parse/hooks/triggers', json.dumps(
-       {"className": "Tournament", "triggerName": "beforeDelete", "url": "https://api.example.com/Scores/beforeDelete"}
-     ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('POST', '/parse/hooks/triggers', json.dumps({
+    "className": "Tournament",
+    "triggerName": "beforeDelete",
+    "url": "https://api.example.com/Scores/beforeDelete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -406,18 +436,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions/baz

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/functions/baz', json.dumps(
-    {"url":"https://api.example.com/_baz"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/functions/baz', json.dumps({
+    "url":"https://api.example.com/_baz"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -443,18 +476,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions/bar

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/functions/bar', json.dumps(
-      {"url":"https://api.example.com/_bar"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/functions/bar', json.dumps({
+    "url": "https://api.example.com/_bar"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -481,18 +517,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers/Game/beforeSave

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/triggers/Game/beforeSave', json.dumps(
-      {"url": "https://api.example.com/Game/_beforeSave"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/triggers/Game/beforeSave', json.dumps({
+    "url": "https://api.example.com/Game/_beforeSave"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -522,18 +561,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers/Tournament/beforeDelete

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/triggers/Tournament/beforeDelete', json.dumps(
-      {"url": "https://api.example.com/Scores/beforeDelete"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/triggers/Tournament/beforeDelete', json.dumps({
+    "url": "https://api.example.com/Scores/beforeDelete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -561,18 +603,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions/foo

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/functions/foo', json.dumps(
-      {"__op": "Delete"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/functions/foo', json.dumps({
+    "__op": "Delete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -595,18 +640,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/functions/sendMessage

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/functions/sendMessage', json.dumps(
-      {"__op": "Delete"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/functions/sendMessage', json.dumps({
+    "__op": "Delete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -629,18 +677,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers/Game/beforeSave

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/triggers/Game/beforeSave', json.dumps(
-      {"__op": "Delete"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/triggers/Game/beforeSave', json.dumps({
+    "__op": "Delete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -663,18 +714,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/hooks/triggers/Tournament/beforeDelete

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/hooks/triggers/Tournament/beforeDelete', json.dumps(
-      {"__op": "Delete"}
-      ), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/hooks/triggers/Tournament/beforeDelete', json.dumps({
+    "__op": "Delete"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/objects.md b/_includes/rest/objects.md index cadebea3..3239da66 100644 --- a/_includes/rest/objects.md +++ b/_includes/rest/objects.md @@ -66,18 +66,21 @@ To create a new object on Parse, send a POST request to the class URL containing https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/classes/GameScore', json.dumps({
-       "score": 1337,
-       "playerName": "Sean Plott",
-       "cheatMode": False
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "score": 1337,
+    "playerName": "Sean Plott",
+    "cheatMode": False
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 results = json.loads(connection.getresponse().read())
 print results
 
@@ -111,15 +114,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore/Ed1nuqPvcm', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -152,16 +158,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"include":"game"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"include": "game"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore/Ed1nuqPvcm?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -179,16 +189,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"include":"game","readPreference":"SECONDARY","includeReadPreference":"SECONDARY_PREFERRED"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"include": "game", "readPreference": "SECONDARY", "includeReadPreference": "SECONDARY_PREFERRED"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore/Ed1nuqPvcm?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -208,18 +222,21 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "score": 73453
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "score": 73453
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -245,21 +262,24 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "score": {
-         "__op": "Increment",
-         "amount": 1
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "score": {
+        "__op": "Increment",
+        "amount": 1
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -275,21 +295,24 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "score": {
-         "__op": "Increment",
-         "amount": -1
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "score": {
+        "__op": "Increment",
+        "amount": -1
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -313,24 +336,27 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "skills": {
-         "__op": "AddUnique",
-         "objects": [
-           "flying",
-           "kungfu"
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "skills": {
+        "__op": "AddUnique",
+        "objects": [
+            "flying",
+            "kungfu"
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -348,27 +374,30 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "opponents": {
-         "__op": "AddRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "Player",
-             "objectId": "Vx4nudeWn"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "opponents": {
+        "__op": "AddRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "Player",
+                "objectId": "Vx4nudeWn"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -384,27 +413,30 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "opponents": {
-         "__op": "RemoveRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "Player",
-             "objectId": "Vx4nudeWn"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "opponents": {
+        "__op": "RemoveRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "Player",
+                "objectId": "Vx4nudeWn"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -420,15 +452,18 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/classes/GameScore/Ed1nuqPvcm', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -444,20 +479,23 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/classes/GameScore/Ed1nuqPvcm', json.dumps({
-       "opponents": {
-         "__op": "Delete"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "opponents": {
+        "__op": "Delete"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -496,35 +534,38 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/batch

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/batch', json.dumps({
-       "requests": [
-         {
-           "method": "POST",
-           "path": "/parse/classes/GameScore",
-           "body": {
-             "score": 1337,
-             "playerName": "Sean Plott"
-           }
-         },
-         {
-           "method": "POST",
-           "path": "/parse/classes/GameScore",
-           "body": {
-             "score": 1338,
-             "playerName": "ZeroCool"
-           }
-         }
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "requests": [
+        {
+            "method": "POST",
+            "path": "/parse/classes/GameScore",
+            "body": {
+                "score": 1337,
+                "playerName": "Sean Plott"
+            }
+        },
+        {
+            "method": "POST",
+            "path": "/parse/classes/GameScore",
+            "body": {
+                "score": 1338,
+                "playerName": "ZeroCool"
+            }
+        }
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -576,30 +617,33 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/batch

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/batch', json.dumps({
-       "requests": [
-         {
-           "method": "PUT",
-           "path": "/parse/classes/GameScore/Ed1nuqPvcm",
-           "body": {
-             "score": 999999
-           }
-         },
-         {
-           "method": "DELETE",
-           "path": "/parse/classes/GameScore/Cpl9lrueY5"
-         }
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "requests": [
+        {
+            "method": "PUT",
+            "path": "/parse/classes/GameScore/Ed1nuqPvcm",
+            "body": {
+                "score": 999999
+            }
+        },
+        {
+            "method": "DELETE",
+            "path": "/parse/classes/GameScore/Cpl9lrueY5"
+        }
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -641,23 +685,27 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "createdAt": {
-         "$gte": {
-           "__type": "Date",
-           "iso": "2022-01-01T12:23:45.678Z"
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "createdAt": {
+        "$gte": {
+            "__type": "Date",
+            "iso": "2022-01-01T12:23:45.678Z"
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/push-notifications.md b/_includes/rest/push-notifications.md index 46fb7fb2..88114096 100644 --- a/_includes/rest/push-notifications.md +++ b/_includes/rest/push-notifications.md @@ -43,22 +43,25 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/installations

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/installations', json.dumps({
-       "deviceType": "ios",
-       "deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
-       "channels": [
-         ""
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "deviceType": "ios",
+    "deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
+    "channels": [
+        ""
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -103,23 +106,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/installations

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/installations', json.dumps({
-       "deviceType": "android",
-       "pushType": "gcm",
-       "deviceToken": "APA91bFMvbrGg4cp3KUV_7dhU1gmwE_...",
-       "channels": [
-         ""
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "deviceType": "android",
+    "pushType": "gcm",
+    "deviceToken": "APA91bFMvbrGg4cp3KUV_7dhU1gmwE_...",
+    "channels": [
+        ""
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -135,15 +141,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/installations/mrmBZvsErB', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -183,23 +192,26 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/installations/mrmBZvsErB', json.dumps({
-       "deviceType": "ios",
-       "deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
-       "channels": [
-         "",
-         "foo"
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "deviceType": "ios",
+    "deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
+    "channels": [
+        "",
+        "foo"
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -219,15 +231,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/installations

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/installations', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -275,15 +290,18 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/installations/mrmBZvsErB', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -317,20 +335,23 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/installations/mrmBZvsErB', json.dumps({
-       "channels": [
-         "Giants"
-       ]
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "channels": [
+        "Giants"
+    ]
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -362,24 +383,27 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "channels": [
-         "Giants",
-         "Mets"
-       ],
-       "data": {
-         "alert": "The Giants won against the Mets 2-3."
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "channels": [
+        "Giants",
+        "Mets"
+    ],
+    "data": {
+        "alert": "The Giants won against the Mets 2-3."
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -407,20 +431,23 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/installations/mrmBZvsErB', json.dumps({
-       "scores": True,
-       "gameResults": True,
-       "injuryReports": True
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "scores": True,
+    "gameResults": True,
+    "injuryReports": True
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -442,22 +469,25 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/installations/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/installations/mrmBZvsErB', json.dumps({
-       "user": {
-         "__type": "Pointer",
-         "className": "_User",
-         "objectId": "vmRZXZ1Dvo"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "user": {
+        "__type": "Pointer",
+        "className": "_User",
+        "objectId": "vmRZXZ1Dvo"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -482,23 +512,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "injuryReports": True
-       },
-       "data": {
-         "alert": "Willie Hayes injured by own pop fly."
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "injuryReports": True
+    },
+    "data": {
+        "alert": "Willie Hayes injured by own pop fly."
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -522,24 +555,27 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "channels": "Giants",
-         "scores": True
-       },
-       "data": {
-         "alert": "The Giants scored a run! The score is now 2-2."
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "channels": "Giants",
+        "scores": True
+    },
+    "data": {
+        "alert": "The Giants scored a run! The score is now 2-2."
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -573,37 +609,40 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "user": {
-           "$inQuery":{
-              "where":{
-                "location":{
-                  "$nearSphere":{
-                    "__type":"GeoPoint",
-                      "latitude":51.252437591552734,
-                      "longitude":-1.6038470268249512
-                    },
-                  "$maxDistanceInMiles":1.0
-                }
-              },
-              "className":"_User"
+    "where": {
+        "user": {
+            "$inQuery": {
+                "where": {
+                    "location": {
+                        "$nearSphere": {
+                            "__type": "GeoPoint",
+                            "latitude": 51.252437591552734,
+                            "longitude": -1.6038470268249512
+                        },
+                        "$maxDistanceInMiles": 1.0
+                    }
+                },
+                "className": "_User"
             }
-         }
-       },
-       "data": {
-         "alert": "Free hotdogs at the Parse concession stand!"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+        }
+    },
+    "data": {
+        "alert": "Free hotdogs at the Parse concession stand!"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -649,26 +688,29 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "channels": [
-         "Mets"
-       ],
-       "data": {
-         "alert": "The Mets scored! The game is now tied 1-1.",
-         "badge": "Increment",
-         "sound": "cheering.caf",
-         "title": "Mets Score!"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "channels": [
+        "Mets"
+    ],
+    "data": {
+        "alert": "The Mets scored! The game is now tied 1-1.",
+        "badge": "Increment",
+        "sound": "cheering.caf",
+        "title": "Mets Score!"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -678,26 +720,29 @@ It is also possible to specify your own data in this dictionary. As explained in

 

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "channels": [
-         "Indians"
-       ],
-       "data": {
-         "action": "com.example.UPDATE_STATUS",
-         "alert": "Ricky Vaughn was injured during the game last night!",
-         "name": "Vaughn",
-         "newsItem": "Man bites dog"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "channels": [
+        "Indians"
+    ],
+    "data": {
+        "action": "com.example.UPDATE_STATUS",
+        "alert": "Ricky Vaughn was injured during the game last night!",
+        "name": "Vaughn",
+        "newsItem": "Man bites dog"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -722,21 +767,24 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "expiration_time": "2015-03-19T22:05:08Z",
-       "data": {
-         "alert": "Season tickets on sale until March 19, 2015"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "expiration_time": "2015-03-19T22:05:08Z",
+    "data": {
+        "alert": "Season tickets on sale until March 19, 2015"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -758,22 +806,25 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "push_time": "2015-03-13T22:05:08Z",
-       "expiration_interval": 518400,
-       "data": {
-         "alert": "Season tickets on sale until March 19, 2015"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "push_time": "2015-03-13T22:05:08Z",
+    "expiration_interval": 518400,
+    "data": {
+        "alert": "Season tickets on sale until March 19, 2015"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -800,23 +851,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "deviceType": "android"
-       },
-       "data": {
-         "alert": "Your suitcase has been filled with tiny robots!"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "deviceType": "android"
+    },
+    "data": {
+        "alert": "Your suitcase has been filled with tiny robots!"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -837,23 +891,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "deviceType": "ios"
-       },
-       "data": {
-         "alert": "Your suitcase has been filled with tiny apples!"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "deviceType": "ios"
+    },
+    "data": {
+        "alert": "Your suitcase has been filled with tiny apples!"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -874,23 +931,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "deviceType": "winrt"
-       },
-       "data": {
-         "alert": "Your suitcase has been filled with tiny glass!"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "deviceType": "winrt"
+    },
+    "data": {
+        "alert": "Your suitcase has been filled with tiny glass!"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -911,23 +971,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "deviceType": "winphone"
-       },
-       "data": {
-         "alert": "Your suitcase is very hip; very metro."
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "deviceType": "winphone"
+    },
+    "data": {
+        "alert": "Your suitcase is very hip; very metro."
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -953,24 +1016,27 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/push

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/push', json.dumps({
-       "where": {
-         "user_id": "user_123"
-       },
-       "push_time": "2015-03-19T12:00:00Z",
-       "data": {
-         "alert": "You previously created a reminder for the game today"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "where": {
+        "user_id": "user_123"
+    },
+    "push_time": "2015-03-19T12:00:00Z",
+    "data": {
+        "alert": "You previously created a reminder for the game today"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1007,21 +1073,24 @@ curl -X POST \ https://api.parse.com/1/push

-import json,httplib
-connection = httplib.HTTPSConnection('api.parse.com', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('api.parse.com', 443)
 connection.connect()
 connection.request('POST', '/1/push', json.dumps({
-       "data": {
-         "alert": "The default alert for all languages",
-         "alert-fr": "Une alerte en français"
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "data": {
+        "alert": "The default alert for all languages",
+        "alert-fr": "Une alerte en français"
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/queries.md b/_includes/rest/queries.md index 027f1aad..0db42acb 100644 --- a/_includes/rest/queries.md +++ b/_includes/rest/queries.md @@ -12,15 +12,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -63,19 +66,23 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "playerName": "Sean Plott",
-       "cheatMode": False
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "playerName": "Sean Plott",
+    "cheatMode": False
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -109,21 +116,25 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "score": {
-         "$gte": 1000,
-         "$lte": 3000
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "score": {
+        "$gte": 1000,
+        "$lte": 3000
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -139,26 +150,30 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "score": {
-         "$in": [
-           1,
-           3,
-           5,
-           7,
-           9
-         ]
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "score": {
+        "$in": [
+            1,
+            3,
+            5,
+            7,
+            9
+        ]
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -182,24 +197,28 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "playerName": {
-         "$nin": [
-           "Jonathan Walsh",
-           "Dario Wunsch",
-           "Shawn Simon"
-         ]
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "playerName": {
+        "$nin": [
+            "Jonathan Walsh",
+            "Dario Wunsch",
+            "Shawn Simon"
+        ]
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -215,20 +234,24 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "score": {
-         "$exists": True
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "score": {
+        "$exists": True
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -244,20 +267,24 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "score": {
-         "$exists": False
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "score": {
+        "$exists": False
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -273,30 +300,34 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/_User

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "hometown": {
-         "$select": {
-           "query": {
-             "className": "Team",
-             "where": {
-               "winPct": {
-                 "$gt": 0.5
-               }
-             }
-           },
-           "key": "city"
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "hometown": {
+        "$select": {
+            "query": {
+                "className": "Team",
+                "where": {
+                    "winPct": {
+                        "$gt": 0.5
+                    }
+                }
+            },
+            "key": "city"
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/_User?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -323,16 +354,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"order":"score"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"order": "score"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -348,16 +383,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"order":"-score"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"order": "-score"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -373,16 +412,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"order":"score,-name"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"order": "score, -name"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -399,16 +442,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"limit":200,"skip":400})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"limit": 200, "skip": 400})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -426,16 +473,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"keys":"[score,playerName]"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"keys": "[score, playerName]"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -451,16 +502,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore/Ed1nuqPvcm

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"excludeKeys":"playerName"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"excludeKeys": "playerName"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore/Ed1nuqPvcm?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -488,29 +543,32 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({
-    "where":json.dumps({
-      "playerName": {
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "playerName": {
         "$nin": [
-          "Jonathan Walsh",
-          "Dario Wunsch",
-          "Shawn Simon"
+            "Jonathan Walsh",
+            "Dario Wunsch",
+            "Shawn Simon"
         ]
-      }
-    }),
-    "order":"score,-name",
-    "limit":200,
-    "skip":400,
-    "keys":"score,playerName"})
+    }
+}),
+"order": "score,-name",
+"limit": 200,
+"skip": 400,
+"keys": "score,playerName"})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -529,18 +587,22 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/RandomObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "arrayKey": 2
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "arrayKey": 2
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/RandomObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -556,24 +618,28 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/RandomObject

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "arrayKey": {
-         "$all": [
-           2,
-           3,
-           4
-         ]
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "arrayKey": {
+        "$all": [
+            2,
+            3,
+            4
+        ]
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/RandomObject?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -593,20 +659,24 @@ curl -X GET \

 # Finds barbecue sauces that start with "Big Daddy"
-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "name": {
-         "$regex": "^Big Daddy"
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "name": {
+        "$regex": "^Big Daddy"
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/BarbecueSauce?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -649,24 +719,28 @@ curl -X GET \

 # Finds barbecue sauces that contains "Daddy"
-import json,httplib,urllib
-connection = httplib.HTTPSConnection('api.parse.com', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "name": {
-         "$text": {
-          "$search": {
-           "$term": "Daddy"
-          }
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('api.parse.com', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "name": {
+        "$text": {
+            "$search": {
+                "$term": "Daddy"
+            }
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/1/classes/BarbecueSauce?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -686,27 +760,30 @@ curl -X GET \

 # Finds string that contains "Daddy" ordered by relevance
-import json,httplib,urllib
-connection = httplib.HTTPSConnection('api.parse.com', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "name": {
-         "$text": {
-          "$search": {
-           "$term": "Daddy"
-          }
-         }
-       }
-     }),
-     "order":"$score",
-     "keys":"$score",
-     })
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('api.parse.com', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "name": {
+        "$text": {
+            "$search": {
+                "$term": "Daddy"
+            }
+        }
+    }
+}),
+"order": "$score",
+"keys": "$score"})
 connection.connect()
 connection.request('GET', '/1/classes/BarbecueSauce?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -726,22 +803,26 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "post": {
-         "__type": "Pointer",
-         "className": "Post",
-         "objectId": "8TOXdXf3tz"
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "post": {
+        "__type": "Pointer",
+        "className": "Post",
+        "objectId": "8TOXdXf3tz"
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -757,27 +838,31 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "post": {
-         "$inQuery": {
-           "where": {
-             "image": {
-               "$exists": True
-             }
-           },
-           "className": "Post"
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "post": {
+        "$inQuery": {
+            "where": {
+                "image": {
+                    "$exists": True
+                }
+            },
+            "className": "Post"
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -793,27 +878,31 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "post": {
-         "$notInQuery": {
-           "where": {
-             "image": {
-               "$exists": True
-             }
-           },
-           "className": "Post"
-         }
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "post": {
+        "$notInQuery": {
+            "where": {
+                "image": {
+                    "$exists": True
+                }
+            },
+            "className": "Post"
+        }
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -829,25 +918,29 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/users

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "$relatedTo": {
-         "object": {
-           "__type": "Pointer",
-           "className": "Post",
-           "objectId": "8TOXdXf3tz"
-         },
-         "key": "likes"
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "$relatedTo": {
+        "object": {
+            "__type": "Pointer",
+            "className": "Post",
+            "objectId": "8TOXdXf3tz"
+        },
+        "key": "likes"
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/users?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -865,16 +958,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"order":"-createdAt","limit":10,"include":"post"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"order": "-createdAt", "limit": 10, "include": "post"})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -915,16 +1012,20 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"order":"-createdAt","limit":10,"include":"post.author"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"order": "-createdAt", "limit": 10, "include": "post.author"})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -948,18 +1049,24 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "playerName": "Jonathan Walsh"
-     }),"count":1,"limit":0})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "playerName": "Jonathan Walsh"
+}),
+"count": 1,
+"limit": 0})
 connection.connect()
 connection.request('GET', '/parse/classes/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -988,29 +1095,33 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Player

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "$or": [
-         {
-           "wins": {
-             "$gt": 150
-           }
-         },
-         {
-           "wins": {
-             "$lt": 5
-           }
-         }
-       ]
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "$or": [
+        {
+            "wins": {
+                "$gt": 150
+            }
+        },
+        {
+            "wins": {
+                "$lt": 5
+            }
+        }
+    ]
+})})
 connection.connect()
 connection.request('GET', '/parse/classes/Player?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1035,17 +1146,21 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/aggregate/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"distinct":"score"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"distinct": "score"})
 connection.connect()
 connection.request('GET', '/parse/aggregate/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1062,19 +1177,24 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/aggregate/GameScore

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"where":json.dumps({
-       "playerName": "Sean Plott"
-     }),"distinct":"score"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
+    "playerName": "Sean Plott"
+}),
+"distinct": "score"})
 connection.connect()
 connection.request('GET', '/parse/aggregate/GameScore?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1105,22 +1225,27 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/aggregate/Player

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"group":json.dumps({
-       "objectId": null,
-       "total": {
-        "$sum":"$score"
-       }
-     }),"distinct":"score"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"group": json.dumps({
+    "objectId": null,
+    "total": {
+        "$sum": "$score"
+    }
+}),
+"distinct": "score"})
 connection.connect()
 connection.request('GET', '/parse/aggregate/Player?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1137,19 +1262,23 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/aggregate/Player

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"project":json.dumps({
-       "score": 1
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"project": json.dumps({
+    "score": 1
+})})
 connection.connect()
 connection.request('GET', '/parse/aggregate/Player?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1166,21 +1295,25 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/aggregate/Player

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"match":json.dumps({
-       "score": {
-        "$gt":15
-       }
-     })})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"match": json.dumps({
+    "score": {
+        "$gt": 15
+    }
+})})
 connection.connect()
 connection.request('GET', '/parse/aggregate/Player?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -1204,32 +1337,34 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/classes/Comment

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({
-  "where":json.dumps({
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"where": json.dumps({
     "post": {
-      "$inQuery": {
-        "where": {
-          "image": {
-            "$exists": True
-          }
-        },
-        "className": "Post"
-      }
+        "$inQuery": {
+            "where": {
+                "image": {
+                    "$exists": True
+                }
+            },
+            "className": "Post"
+        }
     }
-  }),
-  "include":"post",
-  "readPreference":"SECONDARY",
-  "includeReadPreference":"SECONDARY_PREFERRED",
-  "subqueryReadPreference":"NEAREST"
-})
+}),
+"include": "post",
+"readPreference": "SECONDARY",
+"includeReadPreference": "SECONDARY_PREFERRED",
+"subqueryReadPreference": "NEAREST"})
 connection.connect()
 connection.request('GET', '/parse/classes/Comment?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/roles.md b/_includes/rest/roles.md index 568dde69..b3984c9b 100644 --- a/_includes/rest/roles.md +++ b/_includes/rest/roles.md @@ -35,23 +35,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/roles

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/roles', json.dumps({
-       "name": "Moderators",
-       "ACL": {
-         "*": {
-           "read": True
-         }
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "name": "Moderators",
+    "ACL": {
+        "*": {
+            "read": True
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -94,43 +97,46 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/roles

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/roles', json.dumps({
-       "name": "Moderators",
-       "ACL": {
-         "*": {
-           "read": True
-         }
-       },
-       "roles": {
-         "__op": "AddRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "_Role",
-             "objectId": "Ed1nuqPvc"
-           }
-         ]
-       },
-       "users": {
-         "__op": "AddRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "_User",
-             "objectId": "8TOXdXf3tz"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "name": "Moderators",
+    "ACL": {
+        "*": {
+            "read": True
+        }
+    },
+    "roles": {
+        "__op": "AddRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "_Role",
+                "objectId": "Ed1nuqPvc"
+            }
+        ]
+    },
+    "users": {
+        "__op": "AddRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "_User",
+                "objectId": "8TOXdXf3tz"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -162,15 +168,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/roles/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/roles/mrmBZvsErB', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -228,32 +237,35 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/roles/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/roles/mrmBZvsErB', json.dumps({
-       "users": {
-         "__op": "AddRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "_User",
-             "objectId": "8TOXdXf3tz"
-           },
-           {
-             "__type": "Pointer",
-             "className": "_User",
-             "objectId": "g7y9tkhB7O"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "users": {
+        "__op": "AddRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "_User",
+                "objectId": "8TOXdXf3tz"
+            },
+            {
+                "__type": "Pointer",
+                "className": "_User",
+                "objectId": "g7y9tkhB7O"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -280,27 +292,30 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/roles/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/roles/mrmBZvsErB', json.dumps({
-       "roles": {
-         "__op": "RemoveRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "_Role",
-             "objectId": "Ed1nuqPvc"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "roles": {
+        "__op": "RemoveRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "_Role",
+                "objectId": "Ed1nuqPvc"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -319,15 +334,18 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/roles/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/roles/mrmBZvsErB', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -342,16 +360,19 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/roles/mrmBZvsErB

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/roles/mrmBZvsErB', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -406,25 +427,28 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/roles/<ModeratorsRoleObjectId>

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/roles/<ModeratorsRoleObjectId>', json.dumps({
-       "roles": {
-         "__op": "AddRelation",
-         "objects": [
-           {
-             "__type": "Pointer",
-             "className": "_Role",
-             "objectId": "<AdministratorsRoleObjectId>"
-           }
-         ]
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "roles": {
+        "__op": "AddRelation",
+        "objects": [
+            {
+                "__type": "Pointer",
+                "className": "_Role",
+                "objectId": "<AdministratorsRoleObjectId>"
+            }
+        ]
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/schemas.md b/_includes/rest/schemas.md index 7925ff66..13ca270a 100644 --- a/_includes/rest/schemas.md +++ b/_includes/rest/schemas.md @@ -26,16 +26,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/schemas

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/schemas', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -83,16 +86,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/schemas/Game

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/schemas/Game', "", {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -119,18 +125,26 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/schemas/City

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/schemas/City', json.dumps({
-       "className":"City","fields":{"name":{"type":"String"} }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "className": "City",
+    "fields": {
+        "name": {
+            "type": "String"
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -159,18 +173,31 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/schemas/City

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/schemas/City', json.dumps({
-       "className":"City","fields":{"name":{"type":"String"},"indexes":{"indexName":{"name":1} }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "className": "City",
+    "fields": {
+        "name": {
+            "type": "String"
+        },
+        "indexes": {
+            "indexName": {
+                "name": 1
+            }
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -201,18 +228,31 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/schemas/City

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/schemas/City', json.dumps(
-       "className":"City","fields":{"population":{"type":"Number"},"indexes":{"population_index":{"population":1} }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/schemas/City', json.dumps({
+    "className": "City",
+    "fields": {
+        "population": {
+            "type": "Number"
+        },
+        "indexes": {
+            "population_index": {
+                "population": 1
+            }
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -241,18 +281,31 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/schemas/City

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/schemas/City', json.dumps(
-       "className":"City","fields":{"population":{"__op" : "Delete"},"indexes":{"population_index":{"__op" : "Delete"} }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/schemas/City', json.dumps({
+    "className": "City",
+    "fields": {
+        "population": {
+            "__op": "Delete"
+        },
+        "indexes": {
+            "population_index": {
+                "__op" : "Delete"
+            }
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -270,14 +323,17 @@ curl -X DELETE\ https://YOUR.PARSE-SERVER.HERE/parse/schemas/City

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/schemas/City', "", {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "Content-Type": "application/json"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/sessions.md b/_includes/rest/sessions.md index bd5f135e..0535e2bd 100644 --- a/_includes/rest/sessions.md +++ b/_includes/rest/sessions.md @@ -45,16 +45,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/sessions/Axy98kq1B09

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/sessions/Axy98kq1B09', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -69,16 +72,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/sessions/me

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/sessions/me', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -97,16 +103,19 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/sessions/Axy98kq1B09

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/logout', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -123,16 +132,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/sessions

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/sessions', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -149,16 +161,19 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/logout

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/logout', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -173,16 +188,19 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/sessions/Axy98kq1B09

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/sessions/Axy98kq1B09', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -211,18 +229,20 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/sessions/me

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
-connection.request('PUT', '/parse/sessions/me', json.dumps({
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:aVrtljyb7E8xKo9256gfvp4n2",
-       "Content-Type": "application/json"
-     })
+connection.request('PUT', '/parse/sessions/me', '', {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:aVrtljyb7E8xKo9256gfvp4n2",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
diff --git a/_includes/rest/users.md b/_includes/rest/users.md index 69c01031..2cffd23b 100644 --- a/_includes/rest/users.md +++ b/_includes/rest/users.md @@ -23,21 +23,24 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/users

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/users', json.dumps({
-       "username": "cooldude6",
-       "password": "p_n7!-e8",
-       "phone": "415-392-0202"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Revocable-Session": "1",
-       "Content-Type": "application/json"
-     })
+    "username": "cooldude6",
+    "password": "p_n7!-e8",
+    "phone": "415-392-0202"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Revocable-Session": "1",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -74,20 +77,23 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/login

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/login', json.dumps({
-       "username": "cooldude6",
-       "password": "p_n7!-e8"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Revocable-Session": "1",
-       "Content-Type": "application/json"
-     })
+    "username": "cooldude6",
+    "password": "p_n7!-e8"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Revocable-Session": "1",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -126,18 +132,21 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/verificationEmailRequest

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/verificationEmailRequest', json.dumps({
-       "email": "email@example.com"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "email": "email@example.com"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -157,18 +166,21 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/requestPasswordReset

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/requestPasswordReset', json.dumps({
-       "email": "coolguy@iloveapps.com"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "Content-Type": "application/json"
-     })
+    "email": "coolguy@iloveapps.com"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -186,15 +198,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/users/g7y9tkhB7O

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/users/g7y9tkhB7O', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -223,16 +238,19 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/users/me

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/users/me', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -264,19 +282,22 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/users/g7y9tkhB7O

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/users/g7y9tkhB7O', json.dumps({
-       "phone": "415-369-6201"
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im",
-       "Content-Type": "application/json"
-     })
+    "phone": "415-369-6201"
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -300,15 +321,18 @@ curl -X GET \ https://YOUR.PARSE-SERVER.HERE/parse/users

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('GET', '/parse/users', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -350,16 +374,19 @@ curl -X DELETE \ https://YOUR.PARSE-SERVER.HERE/parse/users/g7y9tkhB7O

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('DELETE', '/parse/users/g7y9tkhB7O', '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:pnktnjyb996sj4p156gjtp4im"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -436,28 +463,31 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/users

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('POST', '/parse/users', json.dumps({
-       "authData": {
-         "twitter": {
-           "id": "12345678",
-           "screen_name": "ParseIt",
-           "consumer_key": "SaMpLeId3X7eLjjLgWEw",
-           "consumer_secret": "SaMpLew55QbMR0vTdtOACfPXa5UdO2THX1JrxZ9s3c",
-           "auth_token": "12345678-SaMpLeTuo3m2avZxh5cjJmIrAfx4ZYyamdofM7IjU",
-           "auth_token_secret": "SaMpLeEb13SpRzQ4DAIzutEkCE2LBIm2ZQDsP3WUU"
-         }
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Revocable-Session": "1",
-       "Content-Type": "application/json"
-     })
+    "authData": {
+        "twitter": {
+            "id": "12345678",
+            "screen_name": "ParseIt",
+            "consumer_key": "SaMpLeId3X7eLjjLgWEw",
+            "consumer_secret": "SaMpLew55QbMR0vTdtOACfPXa5UdO2THX1JrxZ9s3c",
+            "auth_token": "12345678-SaMpLeTuo3m2avZxh5cjJmIrAfx4ZYyamdofM7IjU",
+            "auth_token_secret": "SaMpLeEb13SpRzQ4DAIzutEkCE2LBIm2ZQDsP3WUU"
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Revocable-Session": "1",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -531,25 +561,28 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/users/uMz0YZeAqc

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/users/uMz0YZeAqc', json.dumps({
-       "authData": {
-         "facebook": {
-           "id": "123456789",
-           "access_token": "SaMpLeAAibS7Q55FSzcERWIEmzn6rosftAr7pmDME10008bWgyZAmv7mziwfacNOhWkgxDaBf8a2a2FCc9Hbk9wAsqLYZBLR995wxBvSGNoTrEaL",
-           "expiration_date": "2022-01-01T12:23:45.678Z"
-         }
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:samplei3l83eerhnln0ecxgy5",
-       "Content-Type": "application/json"
-     })
+    "authData": {
+        "facebook": {
+            "id": "123456789",
+            "access_token": "SaMpLeAAibS7Q55FSzcERWIEmzn6rosftAr7pmDME10008bWgyZAmv7mziwfacNOhWkgxDaBf8a2a2FCc9Hbk9wAsqLYZBLR995wxBvSGNoTrEaL",
+            "expiration_date": "2022-01-01T12:23:45.678Z"
+        }
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:samplei3l83eerhnln0ecxgy5",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -574,21 +607,24 @@ curl -X PUT \ https://YOUR.PARSE-SERVER.HERE/parse/users/uMz0YZeAqc

-import json,httplib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+import http.client
+import json
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
 connection.connect()
 connection.request('PUT', '/parse/users/uMz0YZeAqc', json.dumps({
-       "authData": {
-         "facebook": null
-       }
-     }), {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Session-Token": "r:samplei3l83eerhnln0ecxgy5",
-       "Content-Type": "application/json"
-     })
+    "authData": {
+        "facebook": null
+    }
+}), {
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Session-Token": "r:samplei3l83eerhnln0ecxgy5",
+    "Content-Type": "application/json"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)
 
@@ -639,18 +675,22 @@ curl -X POST \ https://YOUR.PARSE-SERVER.HERE/parse/loginAs

-import json,httplib,urllib
-connection = httplib.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
-params = urllib.urlencode({"userId":"abc123"})
+import http.client
+import json
+import urllib.parse
+
+
+connection = http.client.HTTPSConnection('YOUR.PARSE-SERVER.HERE', 443)
+params = urllib.parse.urlencode({"userId": "abc123"})
 connection.connect()
 connection.request('POST', '/parse/loginAs?%s' % params, '', {
-       "X-Parse-Application-Id": "${APPLICATION_ID}",
-       "X-Parse-REST-API-Key": "${REST_API_KEY}",
-       "X-Parse-Master-Key": "${MASTER_KEY}",
-       "X-Parse-Revocable-Session": "1"
-     })
+    "X-Parse-Application-Id": "${APPLICATION_ID}",
+    "X-Parse-REST-API-Key": "${REST_API_KEY}",
+    "X-Parse-Master-Key": "${MASTER_KEY}",
+    "X-Parse-Revocable-Session": "1"
+})
 result = json.loads(connection.getresponse().read())
-print result
+print(result)