![](/img/trans.png)
[英]Fatal error: Uncaught UnexpectedValueException: The server returned an unexpected value. Expected “HTTP/1.1 101”, had “”
[英]an unexpected HTTP status code was returned by the server
我的 jasper 報告有問題,他們在 jasper 服務器上使用 jaspersoft/rest-client 將它們集成到我的 php 應用程序中。 (wamp: php:5.6.31,mySql 5.7.19)(Jasperserver 6.6)
require_once __DIR__ . "/vendor/autoload.php";
use Jaspersoft\Client\Client;
use Jaspersoft\Exception\RESTRequestException;
try{
$c = new Client(
"http://localhost:8081/jasperserver-pro",
"superuser",
"superuser",
"organization_1"
);
$report = $c->reportService()->runReport('/reports/Blank_A4_1', 'html');
echo $report;
} catch (RESTRequestException $e) {
echo 'RESTRequestException:';
echo '</br>Exception message: ', $e->getMessage(), "\n";
echo '</br>Set parameters: ';
var_dump($e->parameters);
echo '</br>Expected status code:';
var_dump($e->expectedStatusCodes);
echo '</br>Error code: ', $e->errorCode, "\n";
}
我希望看到我的報告,但實際上我只有異常“服務器返回了意外的 HTTP 狀態代碼”
確切的回聲是:
RESTRequestException:
Exception message: An unexpected HTTP status code was returned by the server
Set parameters:
C:\wamp64\www\TestBI\index.php:29:null
Expected status code:
C:\wamp64\www\TestBI\index.php:31:
array (size=1)
0 => int 200
Error code:
在某些情況下,expectedStatusCodes 不會作為超時或進程終止的示例在響應中重新調整。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.