简体   繁体   中英

Laravel Guzzle returns blank response in Get() method

I use this code to get balance from another server, it works fine on XAMPP locally, but it doesn't on the production server, it just returns blank response page.

public static function balance(){
    try {
        return (string) (new \GuzzleHttp\Client())
                  ->get("http://www.*****.ps/getbalance.php?user_name=****&user_pass=*****")
                  ->getBody();
    } catch (\Exception $e) {
        return '-';
    }
    return '-';
}

My issue was a problem with the destination server, for some reason our server got blocked. There is no problem in the mentioned code. It works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM