SarkariResultess QA Bank

PHP content type JSON response कैसे set करते हैं? को secure तरीके से कैसे implement करें?

Other 0 Views Verified
PHP content type JSON response कैसे set करते हैं? को secure तरीके से कैसे implement करें? सही विकल्प चुनें और code/solution को समझें।
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

header.json();

header.json();
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

content_type('json');

content_type('json');
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

response.header.json();

response.header.json();
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified Correct Answer

header('Content-Type: application/json');

header('Content-Type: application/json');
Additional Explanation
Content-Type response header client को representation type बताता है। User input को trust न करें; validation, escaping और prepared statements context के अनुसार उपयोग करें।