Метод 1: использование API Hostinger (Python)
import requests
def register_hostinger(email, password):
url = "https://api.hostinger.com/v1/users"
payload = {
"email": email,
"password": password
}
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 201:
print("Registration successful!")
else:
print("Registration failed.")
# Example usage
email = "example@example.com"
password = "examplePassword"
register_hostinger(email, password)
Метод 2: использование Hostinger PHP SDK (PHP)
<?php
require_once('vendor/autoload.php');
use Hostinger\HostingerAPI;
$api = new HostingerAPI('YOUR_API_KEY');
$email = 'example@example.com';
$password = 'examplePassword';
$response = $api->createUser($email, $password);
if ($response->success) {
echo 'Registration successful!';
} else {
echo 'Registration failed.';
}
?>