cURL 复制
curl -X POST "https://cx4.cn/openApi/dev/jwt" -H "X-Api-Key: 你的SecretKey" -d "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&action=decode&secret=your-256-bit-secret&alg=HS256&payload={"uid":10001}&ttl=7200&iss=api-platform&sub=10001"
JavaScript 复制
fetch('https://cx4.cn/openApi/dev/jwt', {
method: 'POST',
headers: {
'X-Api-Key': '你的SecretKey',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&action=decode&secret=your-256-bit-secret&alg=HS256&payload={"uid":10001}&ttl=7200&iss=api-platform&sub=10001'
})
.then(res => res.json())
.then(data => console.log(data));
PHP 复制
post('https://cx4.cn/openApi/dev/jwt', [
'headers' => ['X-Api-Key' => '你的SecretKey'],
'form_params' => ['token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...', 'action' => 'decode', 'secret' => 'your-256-bit-secret', 'alg' => 'HS256', 'payload' => '{"uid":10001}', 'ttl' => '7200', 'iss' => 'api-platform', 'sub' => '10001'],
]);
echo $response->getBody();
Java 复制
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://cx4.cn/openApi/dev/jwt"))
.header("X-Api-Key", "你的SecretKey")
.header("Content-Type", "application/x-www-form-urlencoded")
.POST(HttpRequest.BodyPublishers.ofString("token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&action=decode&secret=your-256-bit-secret&alg=HS256&payload={"uid":10001}&ttl=7200&iss=api-platform&sub=10001"))
.build();
HttpResponse response = client.send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Python 复制
import requests
res = requests.post('https://cx4.cn/openApi/dev/jwt',
headers={'X-Api-Key': '你的SecretKey'},
data={'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...', 'action': 'decode', 'secret': 'your-256-bit-secret', 'alg': 'HS256', 'payload': '{"uid":10001}', 'ttl': '7200', 'iss': 'api-platform', 'sub': '10001'})
print(res.json())