import requests
url = "https://www.nftoken.info/api/gen"
data = {"netflix_id": "YOUR_NETFLIX_ID", "secret_key": "YOUR_SECRET_KEY"}
r = requests.post(url, json=data).json()
print(r.get('login_url') if r.get('success') else r.get('error'))
fetch('https://www.nftoken.info/api/gen', {
method: 'POST',
headers: {'Content-Type':'application/json'},
body: JSON.stringify({netflix_id:'YOUR_NETFLIX_ID',secret_key:'YOUR_SECRET_KEY'})
}).then(r=>r.json()).then(d=>console.log(d.success?d.login_url:d.error));
curl -X POST https://www.nftoken.info/api/gen -H "Content-Type: application/json" -d '{"netflix_id":"YOUR_NETFLIX_ID","secret_key":"YOUR_SECRET_KEY"}'
<?php
$url = "https://www.nftoken.info/api/gen";
$data = ["netflix_id"=>"YOUR_NETFLIX_ID","secret_key"=>"YOUR_SECRET_KEY"];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
echo $result['success'] ? $result['login_url'] : $result['error'];
curl_close($ch);
?>
import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = "{"netflix_id":"YOUR_NETFLIX_ID","secret_key":"YOUR_SECRET_KEY"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://www.nftoken.info/api/gen"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import ("bytes";"encoding/json";"fmt";"net/http")
func main() {
url := "https://www.nftoken.info/api/gen"
data := map[string]string{"netflix_id":"YOUR_NETFLIX_ID","secret_key":"YOUR_SECRET_KEY"}
jsonData, _ := json.Marshal(data)
resp, _ := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v
", result)
}