我收到一个包含在pre标签内的响应。(如)
结果..
注意:
获得回复200 ok。但格式不正确
我看到了负责从服务器获取值的函数,并且还通过SQL查询了它们的值。
路径:
/ widgets /?action = get-add-modal-content&dashboard-id = 548&dashboard-type = user
结果:
{"widgets_categories": ...}
代码:
namespace Tuleap\Dashboard\User;
use Tuleap\Dashboard\DashboardPresenter;
class UserDashboardPresenter extends DashboardPresenter
{
public $user_id;
public function __construct(UserDashboard $dashboard, $is_active, array $widgets)
{
parent::__construct($dashboard, $is_active, $widgets);
$this->user_id = $dashboard->getUserId();
$this->url_add_widget_content = '/widgets/?'. http_build_query(
array(
'action' => 'get-add-modal-content',
'dashboard-id' => $this->id,
'dashboard-type' => UserDashboardController::DASHBOARD_TYPE
)
);
$this->url_add_widget = '/widgets/?'. http_build_query(
array(
'action' => 'add-widget',
'dashboard-id' => $this->id,
'dashboard-type' => UserDashboardController::DASHBOARD_TYPE
)
);
}
}
我期望使用JSON,但它返回字符串。