国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

嘗試從 search.maven.org 檢索最新版本的套件時(shí)遇到錯(cuò)誤
P粉461599845
P粉461599845 2024-04-05 12:11:23
0
1
2034

「錯(cuò)誤:無(wú)法從 Maven 儲(chǔ)存庫(kù)擷取資料」

同時(shí)從 search.maven.org 檢索最新版本號(hào)。 編寫(xiě)了以下 php 程式碼,我將針對(duì)所有其他套件進(jìn)行修改。

<?php
    $url = "https://search.maven.org/solrsearch/select?q=a:angus-activation-project&rows=1&wt=json";
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($curl);
    curl_close($curl);

    if ($response === false) {
        echo "Error: Retrieving data from the Maven repository failed";
    } else {
        $data = json_decode($response);
    if ($data === null || !property_exists($data, 'response') || count($data->response->docs) == 0) {
        echo "Error: Failed to retrieve the latest version of the artifact from the Maven repository";
    } else {
        $latestVersion = $data->response->docs[0]->v;
        echo "Latest version is" . $latestVersion;
    }
    }
?>

P粉461599845
P粉461599845

全部回覆(1)
P粉409742142

新增此:

curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0");

如果您使用預(yù)設(shè)使用者代理程式的curl,maven會(huì)回傳403禁止。這樣你的請(qǐng)求看起來(lái)像 Firefox

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板