diff --git a/services/npmplus.py b/services/npmplus.py index fc94d98..a8feb75 100644 --- a/services/npmplus.py +++ b/services/npmplus.py @@ -34,11 +34,12 @@ def _request_json( headers: dict[str, str], data: dict[str, Any] | None, verify_tls: bool, + method: str | None = None, ) -> Any: body = None if data is not None: body = json.dumps(data).encode("utf-8") - req = Request(url, headers=headers, data=body) + req = Request(url, headers=headers, data=body, method=method) context = None if not verify_tls: @@ -186,7 +187,7 @@ def set_proxy_host(cfg: dict[str, Any], host_id: int, enabled: bool) -> tuple[bo "User-Agent": "tg-admin-bot", } try: - payload = _request_json(url, headers, None, verify_tls) + payload = _request_json(url, headers, None, verify_tls, method="POST") except Exception as e: return False, str(e) if payload is True or (isinstance(payload, dict) and payload.get("success", True)):