This commit is contained in:
2026-05-20 00:09:28 +02:00
parent 968bf7d102
commit 51b5ddc6f2
695 changed files with 999722 additions and 270 deletions

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env python3
import os
import requests
from requests.auth import HTTPBasicAuth
HDR = {
"User-Agent": "Mozilla/5.0 (compatible; AZA-WooDiagnostic/1.0)",
"Accept": "application/json",
}
def main() -> None:
base = (os.environ.get("AZA_WOOCOMMERCE_URL") or "").strip().rstrip("/")
auth = HTTPBasicAuth(
os.environ.get("AZA_WOOCOMMERCE_CONSUMER_KEY") or "",
os.environ.get("AZA_WOOCOMMERCE_CONSUMER_SECRET") or "",
)
paths = [
"/wp-json/wc/v3",
"/wp-json/wc/v3/orders/1447",
"/wp-json/wc/v3/subscriptions/1448",
"/wp-json/wc/v3/subscriptions?per_page=1",
]
for p in paths:
r = requests.get(base + p, auth=auth, headers=HDR, timeout=15)
print("path", p)
print(" http", r.status_code, "ct", (r.headers.get("content-type") or "")[:40])
try:
j = r.json()
if isinstance(j, dict):
print(" wp_code", j.get("code"))
if "id" in j:
print(" id_field", j.get("id"))
elif isinstance(j, list):
print(" list_len", len(j))
except Exception:
print(" not_json")
if __name__ == "__main__":
main()