This commit is contained in:
parent
8dc0b49e18
commit
0deb6b4284
@ -8,15 +8,20 @@ class FlareRequests(Session):
|
|||||||
if not CLOUDPROXY_ENDPOINT:
|
if not CLOUDPROXY_ENDPOINT:
|
||||||
return super().request(method, url, params, timeout=timeout, **kwargs)
|
return super().request(method, url, params, timeout=timeout, **kwargs)
|
||||||
|
|
||||||
|
post_data = {
|
||||||
|
"cmd": f"request.{method.lower()}",
|
||||||
|
"url": url,
|
||||||
|
"maxTimeout": timeout * 1000,
|
||||||
|
}
|
||||||
|
|
||||||
|
if params:
|
||||||
|
post_data["postData"] = parse.urlencode(params)
|
||||||
|
|
||||||
response = post(
|
response = post(
|
||||||
CLOUDPROXY_ENDPOINT,
|
CLOUDPROXY_ENDPOINT,
|
||||||
json={
|
json=post_data,
|
||||||
"cmd": f"request.{method.lower()}",
|
|
||||||
"url": url,
|
|
||||||
"postData": parse.urlencode(params) if params else "",
|
|
||||||
"maxTimeout": timeout * 1000,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
solution = response.json()
|
solution = response.json()
|
||||||
|
|
||||||
if "solution" in solution:
|
if "solution" in solution:
|
||||||
|
Reference in New Issue
Block a user