(endpoint, data)
| 65 | |
| 66 | |
| 67 | def save_dict(endpoint, data): |
| 68 | if endpoint.startswith(('http:', 'https:', 'ftp:')): |
| 69 | proxies = autodetect_proxy() |
| 70 | |
| 71 | if proxies: |
| 72 | _ = requests.patch(url=endpoint, headers={'content-type':'application/json'}, data=json.dumps(data, indent=4, sort_keys=True), proxies=proxies) |
| 73 | else: |
| 74 | _ = requests.patch(url=endpoint, headers={'content-type':'application/json'}, data=json.dumps(data, indent=4, sort_keys=True)) |
| 75 | else: |
| 76 | with open(endpoint, 'w') as fd: |
| 77 | json.dump(data, fd, indent=4, sort_keys=True) |
no test coverage detected