SOLVED Caract added to body if i use $response

Hi everybody !
If i use slim response object my webserver return space+cr+lf before my real response.
Code with 3 char added :
$retour_json=new stdClass();
return $response->withStatus(200)
->withHeader(‘Content-Type’, ‘text/plain’)

Code without 3 char added :

$retour_json=new stdClass();
$retour_json->Message="Bienvenue sur le webservice HH Informatique";
return json_encode($retour_json);

Please Help me.

EDIT when i use stream all of my docs have 3 byte added :
20 0D 0A 4D 5A 90 00 03 00 00 00 04 00 00 00 FF
If i use an HEXA editor and remove this 3bytes the docs works.

Check your index.php file for invalid PHP tags.

Thank you very much…
A double";" in one of the required file files …
a stupid, sorry mistake.

1 Like