I have a restful ws as folliwing:
public function actionLogin($user, $password){
$tech = Technical::findOne([
'user' => $user,
'password' => $password,
'status' => 'A',
]);
return $tech;
}
When the technical exists everything is ok but when the technical doesn’t I receive this:
<?xml-stylesheet
href="chrome://global/locale/intl.css" type="text/css"
?>
<parsererror>
Error de lectura XML: no se encuentra el elemento Ubicación: http://localhost/project/api/web/v1/sites/login?user=cesar&password=hello Número de línea 1, columna 1:
<sourcetext> ^</sourcetext>
</parsererror>
Is this ok? I was expecting something like:
<response>
<name>Not Found</name>
<message>Object not found: 2</message>
<code>0</code>
<status>404</status>
<type>yii\web\NotFoundHttpException</type>
</response>
<response>
<name>Not Found</name>
<message>Object not found: 2</message>
<code>0</code>
<status>404</status>
<type>yii\web\NotFoundHttpException</type>
</response>
I hope you can help me. Thanks in advance