FIXY ANY ERROS MY CODE IS NOT SENDING ANYTHING TO THE SERVER import requests import time…
- User
FIXY ANY ERROS MY CODE IS NOT SENDING ANYTHING TO THE SERVER import requests import time from requests.exceptions import ConnectTimeout from urllib3.exceptions import MaxRetryError
URL
url = “https://lucky.mzansigaming.com/store-score”
Headers
headers = { ‘accept’: “/”, ‘accept-language’: “en-US,en;q=0.9”, ‘content-type’: “application/json”, ‘sec-ch-ua’: ‘“Chromium”;v=“122”, “Not(A:Brand”;v=“24”, “Google Chrome”;v=“122”’, ‘sec-ch-ua-mobile’: “?1”, ‘sec-ch-ua-platform’: ‘“Android”’, ‘sec-fetch-dest’: “empty”, ‘sec-fetch-mode’: “cors”, ‘sec-fetch-site’: “same-origin”, ‘Referer’: “https://lucky.mzansigaming.com/blue-switcheroo/?unique_id=b325312e-8633-f235-112f-6469607f6e12&game_id=b735f7d9-cc7c-a977-c3d5-65f2ad89f320”, }
JSON Body
json_data = { “unique_id”: “b325312e-8633-f235-112f-6469607f6e12”, “game_id”: “b735f7d9-cc7c-a977-c3d5-65f2ad89f320”, “score”: 1 }
Number of times you want to send the request
num_times = 10 # Example: Change this to your desired number
Delay between requests (in seconds)
delay = 1 # Example: Adjust the delay as needed
successful_responses = 0
for i in range(num_times): while True: try: # Send the request response = requests.post(url, headers=headers, json=json_data, timeout=316)
code# Print the response and increment the successful responses count print(f"Response {successful_responses+1}:\n{response.text}\n") successful_responses += 1 break except ConnectTimeout: print(“Connection timed out. Retrying…”) except MaxRetryError: print(“Max retries exceeded. Retrying…”) except Exception as e: print(f"An error occurred: {e}. Retrying…“) # Delay before sending the next request time.sleep(delay)print(f"Total successful responses: {successful_responses}”)
- Assistant