Mr-Help commited on
Commit
21725a9
ยท
verified ยท
1 Parent(s): 2ee5ff9

Create main.py

Browse files
Files changed (1) hide show
  1. main.py +24 -0
main.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import requests
3
+
4
+ URL = "https://odoo-demo.binrushd.care/api/auth/token"
5
+
6
+ # ูŠูุถู„ ุชุฎุฒูŠู† ุงู„ู‚ูŠู… ุฏูŠ ูƒู…ุชุบูŠุฑุงุช ุจูŠุฆุฉ ุจุฏู„ ู…ุง ุชุชูƒุชุจ ุตุฑูŠุญุฉ ููŠ ุงู„ูƒูˆุฏ
7
+ headers = {
8
+ "CF-Access-Client-Id": "0491b36d7dcabce5b04f1a53f347bb4e.access",
9
+ "CF-Access-Client-Secret": "22152cb41b62393e159daaff7dce433006c3744c5850e6adc15fa3544bb5eb09",
10
+ "login": "binrushd.automation@gmail.com",
11
+ "password": "BR2025",
12
+ "db": "Live_August_25",
13
+ }
14
+
15
+ try:
16
+ resp = requests.get(URL, headers=headers, timeout=20)
17
+ resp.raise_for_status() # ูŠุฑู…ูŠ ุงุณุชุซู†ุงุก ู„ูˆ ุงู„ูƒูˆุฏ ู…ุด 2xx
18
+ # ุฌุฑู‘ุจ JSON ุฃูˆู„ุงู‹ุŒ ูˆู„ูˆ ูุดู„ ุงุทุจุน ุงู„ู†ุต ุงู„ุฎุงู…
19
+ try:
20
+ print(resp.json())
21
+ except ValueError:
22
+ print(resp.text)
23
+ except requests.RequestException as e:
24
+ print("HTTP error:", e)