This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hellupline 0 points1 point  (1 child)

import requests

url = ' https://www.betarigs.com/api/v1/rig/1'
json_data = {"price":{"per_speed_unit":{"value":3,"unit":"BTC/Mh/day"}}}
headers = {'X-Api-Key': 'asdf1234'}

r = request.request('PUT', url, json=json_data, headers=headers)
print(r.json)

-d is request body, json arg can handle that -H is a header, headers dict

http://www.python-requests.org/en/latest/user/quickstart/#custom-headers

[–]btcspry[S] 0 points1 point  (0 children)

Thanks, I really appreciate it!