打个盹

file_get_contents 模拟 post

2025-05-27 发布 0条评论
$en = '{"q": "data","source": "en","target": "zh","format": "text","alternatives": 3,"api_key": ""}';
$options = array(
  'http'=>array(
    'method'=>"POST",
    'header'=>"Content-Type: application/json",
    'content' => $en
  )
);
$context = stream_context_create($options);
$data = file_get_contents("https://xxxxx.net/xxxxx", false, $context);