Spaces:
Sleeping
Sleeping
File size: 692 Bytes
9a9f1fb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import httpx
import os
url = "https://justmotes-xvector-db-node.hf.space/collections"
headers = {"api-key": "xvector_secret_pass_123"}
print(f"Testing connection to {url}...")
try:
with httpx.Client(http2=True, verify=False) as client:
r = client.get(url, headers=headers, timeout=10)
print(f"HTTP/2 Status: {r.status_code}")
print(r.text[:200])
except Exception as e:
print(f"HTTP/2 Failed: {e}")
try:
with httpx.Client(http2=False, verify=False) as client:
r = client.get(url, headers=headers, timeout=10)
print(f"HTTP/1.1 Status: {r.status_code}")
print(r.text[:200])
except Exception as e:
print(f"HTTP/1.1 Failed: {e}")
|