mark
mark copied to clipboard
How to change header Content-Type: text/html;charset=utf-8 to application/json
For better handling in some programming we detect Header Content-type json, I did add header('Content-Type: application/json'); but still don't work
For example. use Workerman/Protocols/Http/Response; // ..... return new Response(200, [“ Content-Type” => “ application/json”], json_encode($data));
Ok, Great its work
use Workerman\Protocols\Http\Response; new Response(200, ["Content-Type" => "application/json"], json_encode($data));
but it's make performance little bit slower when I'm using wrk