vv Žádost API vv
$data = $_POST['csrf'];
$headers = [
"x-csrf-token: $data\r\n".
"Content-Type: application/json\r\n".
"Accept: application/json\r\n"
];
$data = <<<DATA
{
"username": "string",
"password": "string",
"gender": "Unknown",
"birthday": "2021-11-22T23:29:51.656Z",
"isTosAgreementBoxChecked": true,
"email": "string",
"locale": "string",
"assetIds": [
0
],
"bodyColorId": 0,
"bodyTypeScale": 0,
"headScale": 0,
"heightScale": 0,
"widthScale": 0,
"proportionScale": 0,
"referralData": {
"acquisitionTime": "2021-11-22T23:29:51.656Z",
"acquisitionReferrer": "string",
"medium": "string",
"source": "string",
"campaign": "string",
"adGroup": "string",
"keyword": "string",
"matchType": "string",
"sendInfo": true,
"requestSessionId": "string",
"offerId": "string"
},
"agreementIds": [
"string"
],
"identityVerificationResultToken": "string",
"captchaId": "string",
"captchaToken": "string",
"captchaProvider": "string"
}
DATA;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://auth.roblox.com/v1/signup');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
}
http://api.aero-dev.xyz/bin/Captcha/CaptchaId.php?i=2 Server mi hlásí "Chyba 400, Váš prohlížeč odeslán neplatný požadavek." Problém je s x-csrf token, když jsem si to dal jako řetězec "x-csrf token: j8acha7hffh" to funguje. Když jsem to dal jako "x-csrf token: $data" vrátí chybu. Snažil jsem se různé způsoby, jak se blíží k této chybě. Změnil jsem záhlaví. Snažil různé způsoby, jak o to žádá. Stále nic opravuje moje chyby. Jsem nový s PHP, prosím, pomozte!