import requests
from requests.structures import CaseInsensitiveDict

url = "https://api.crowdstrike.com/oauth2/token";

headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Authorization"] = "Basic
YjMwMzcwODY3NTUzNDMwNTg5NzA2MjkyNDFmMDE1YWY6VjNKYTk2Y1F4RTFzeTdYbzRnbkt0a2k1djhscXUyU01oSE5VWUwwRg=="

data = "POST"


resp = requests.post(url, headers=headers, data=data)

print(resp.text)
print(resp.status_code)


import requests
from requests.structures import CaseInsensitiveDict

MYurl = "
https://api.crowdstrike.com/intel/combined/indicators/v1?q=123.123.123.123";

headersa = CaseInsensitiveDict()
headersa["Authorization"] = "Bearer "+resp.text

resp1 = requests.get(MYurl, headers=headersa)

print(resp1.status_code)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to