19 lines
545 B
Python
19 lines
545 B
Python
import urllib.request
|
|
import json
|
|
|
|
url = "https://odoodev2.mymachconnect.com/mymach/api/ping"
|
|
data = json.dumps({}).encode('utf-8')
|
|
headers = {
|
|
'Content-Type': 'application/json',
|
|
'X-Odoo-Database': 'mymach-odoodev2-2026'
|
|
}
|
|
|
|
try:
|
|
req = urllib.request.Request(url, data=data, headers=headers, method='POST')
|
|
response = urllib.request.urlopen(req)
|
|
print("Response:", response.read().decode())
|
|
except urllib.error.HTTPError as e:
|
|
print("Error HTTP:", e.code, e.read().decode())
|
|
except Exception as e:
|
|
print("Error:", e)
|