@@ -14,16 +14,19 @@ curl -X POST \
14
14
<span class =" custom-parse-server-protocol " >https</span >://<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span ><span class =" custom-parse-server-mount " >/parse/</span >files/hello.txt
15
15
</code ></pre >
16
16
<pre ><code class =" python " >
17
- import json,httplib
18
- connection = httplib.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
17
+ import http.client
18
+ import json
19
+
20
+
21
+ connection = http.client.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
19
22
connection.connect()
20
23
connection.request('POST', '<span class =" custom-parse-server-mount " >/parse/</span >files/hello.txt', 'Hello, World!', {
21
- "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
22
- "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
23
- "Content-Type": "text/plain"
24
- })
24
+ "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
25
+ "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
26
+ "Content-Type": "text/plain"
27
+ })
25
28
result = json.loads(connection.getresponse().read())
26
- print result
29
+ print( result)
27
30
</code ></pre >
28
31
</div >
29
32
@@ -55,16 +58,19 @@ curl -X POST \
55
58
<span class =" custom-parse-server-protocol " >https</span >://<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span ><span class =" custom-parse-server-mount " >/parse/</span >files/pic.jpg
56
59
</code ></pre >
57
60
<pre ><code class =" python " >
58
- import json,httplib
59
- connection = httplib.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
61
+ import http.client
62
+ import json
63
+
64
+
65
+ connection = http.client.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
60
66
connection.connect()
61
67
connection.request('POST', '<span class =" custom-parse-server-mount " >/parse/</span >files/pic.jpg', open('myPicture.jpg', 'rb').read(), {
62
- "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
63
- "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
64
- "Content-Type": "image/jpeg"
65
- })
68
+ "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
69
+ "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
70
+ "Content-Type": "image/jpeg"
71
+ })
66
72
result = json.loads(connection.getresponse().read())
67
- print result
73
+ print( result)
68
74
</code ></pre >
69
75
</div >
70
76
@@ -89,23 +95,26 @@ curl -X POST \
89
95
<span class =" custom-parse-server-protocol " >https</span >://<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span ><span class =" custom-parse-server-mount " >/parse/</span >classes/PlayerProfile
90
96
</code ></pre >
91
97
<pre ><code class =" python " >
92
- import json,httplib
93
- connection = httplib.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
98
+ import http.client
99
+ import json
100
+
101
+
102
+ connection = http.client.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
94
103
connection.connect()
95
104
connection.request('POST', '<span class =" custom-parse-server-mount " >/parse/</span >classes/PlayerProfile', json.dumps({
96
- "name": "Andrew",
97
- "picture": {
98
- "name": "...profile.png",
99
- "url:": "...profile.png",
100
- "__type": "File"
101
- }
102
- }), {
103
- "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
104
- "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
105
- "Content-Type": "application/json"
106
- })
105
+ "name": "Andrew",
106
+ "picture": {
107
+ "name": "...profile.png",
108
+ "url:": "...profile.png",
109
+ "__type": "File"
110
+ }
111
+ }), {
112
+ "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
113
+ "X-Parse-REST-API-Key": "<span class =" custom-parse-server-restapikey " >${REST_API_KEY}</span >",
114
+ "Content-Type": "application/json"
115
+ })
107
116
result = json.loads(connection.getresponse().read())
108
- print result
117
+ print( result)
109
118
</code ></pre >
110
119
</div >
111
120
@@ -124,15 +133,18 @@ curl -X DELETE \
124
133
<span class =" custom-parse-server-protocol " >https</span >://<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span ><span class =" custom-parse-server-mount " >/parse/</span >files/...profile.png
125
134
</code ></pre >
126
135
<pre ><code class =" python " >
127
- import json,httplib
128
- connection = httplib.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
136
+ import http.client
137
+ import json
138
+
139
+
140
+ connection = http.client.HTTPSConnection('<span class =" custom-parse-server-url " >YOUR.PARSE-SERVER.HERE</span >', 443)
129
141
connection.connect()
130
142
connection.request('DELETE', '<span class =" custom-parse-server-mount " >/parse/</span >files/...profile.png', '', {
131
- "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
132
- "X-Parse-Master-Key": "<span class =" custom-parse-server-masterkey " >${MASTER_KEY}</span >"
133
- })
143
+ "X-Parse-Application-Id": "<span class =" custom-parse-server-appid " >${APPLICATION_ID}</span >",
144
+ "X-Parse-Master-Key": "<span class =" custom-parse-server-masterkey " >${MASTER_KEY}</span >"
145
+ })
134
146
result = json.loads(connection.getresponse().read())
135
- print result
147
+ print( result)
136
148
</code ></pre >
137
149
</div >
138
150
0 commit comments