/** * set Content-Type header to jsonrequest */ public static function setContentTypeHeader($type='application/json') { if (!self::$send_content_type_header) { // We send json data header( 'Content-Type: '.$type ); self::$send_content_type_header = true; } }