php - Set header HTTP code in Flightphp -


im developing api flightphp microframework , can't set http response code routes. can set , works perfectly:

header('http/1.0 500 error'); 

but want use native function http_response_code() php. 1 don't anything. want use because don't have manually type error message.

to return http response code using flight, can :

flight::route('get /', function(){     flight::json($data, $code = 500); });  

where "$data" variable leads array want send in json. if "$code" not set, default returned http response code "200". https://github.com/mikecao/flight/blob/master/flight/engine.php#l470


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -