| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + x_parse_application_id = "X-Parse-Application-Id" | ||
| 2 | + x_parse_rest_api_key = "X-Parse-REST-API-Key" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + import configs as user | ||
| 2 | + import httpconstants as h | ||
| 3 | + | ||
| 4 | + import requests | ||
| 5 | + import json | ||
| 6 | + | ||
| 7 | + """ | ||
| 8 | + curl -X POST \ | ||
| 9 | + -H "X-Parse-Application-Id: {application_id}" \ | ||
| 10 | + -H "X-Parse-REST-API-Key: {rest_api_key}" \ | ||
| 11 | + --data-urlencode "{\"row1\":\"row1data\", \"row2\":\"row2data\"}" \ | ||
| 12 | + https://parseapi.back4app.com/classes/new | ||
| 13 | + """ | ||
| 14 | + | ||
| 15 | + classes = "classes/new" | ||
| 16 | + | ||
| 17 | + header = dict() | ||
| 18 | + print(classes) | ||
| 19 | + header[h.x_parse_application_id] = user.application_id | ||
| 20 | + header[h.x_parse_rest_api_key] = user.rest_api_key | ||
| 21 | + | ||
| 22 | + payload = {"row1": "row1data", "row2": "row2data"} | ||
| 23 | + print(header) | ||
| 24 | + print(payload) | ||
| 25 | + | ||
| 26 | + r = requests.post(user.server_url+classes, headers=header, data=payload) | ||
| 27 | + print(r.status_code) | ||
| 28 | + | ||
| 29 | + r.raise_for_status() | ||
| 30 | + | ||
| 31 | + pretty_json = json.dumps(json.loads(r.text), indent=4, sort_keys=True) | ||
| 32 | + print(pretty_json) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + x_parse_application_id = "X-Parse-Application-Id" | ||
| 2 | + x_parse_rest_api_key = "X-Parse-REST-API-Key" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments