IDP Post prod

PHOTO EMBED

Mon Apr 29 2024 20:30:31 GMT+0000 (Coordinated Universal Time)

Saved by @CarlosR

def post_data_to_endpoint(host, endpoint, headers, data):  
    url = f"{host}/{endpoint}"  
    response = requests.post(url, headers=headers, data=json.dumps(data))  
        
    if response.status_code == 200:    
        return response.json()    
    else:    
        return f"Error: {response.status_code}"    
  
# Replace with your actual host, endpoint, headers and data  
host = "http://172.24.52.8"    
endpoint = "accor_modeling"    
headers = {"Host": "ds-idm-prod.sb.se.com"}    
data_path = './cannot_predict_testing.json'  
with open(data_path, 'r') as f:  
    data = json.load(f)  
  
print(post_data_to_endpoint(host, endpoint, headers, data))  
content_copyCOPY