mirror of
				https://github.com/LibreTranslate/LibreTranslate.git
				synced 2025-11-04 03:27:14 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			333 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			333 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import requests
 | 
						|
 | 
						|
response = requests.post(
 | 
						|
    url='http://0.0.0.0:5000/translate',
 | 
						|
    headers={'Content-Type': 'application/json'},
 | 
						|
    json={
 | 
						|
         'q': 'Hello World!',
 | 
						|
         'source': 'en',
 | 
						|
         'target': 'en'
 | 
						|
    },
 | 
						|
    timeout=60
 | 
						|
)
 | 
						|
# if server unavailable then requests with raise exception and healthcheck will fail
 |