computer/expressJS1 expressJS req.accepts() method req.accespts(type) req.accepts는 반환하기 가장 적절한 타입을 Accept HTTP Header를 근거로 결정한다.만약 type 중 만족스러운 콘텐츠 형식이 없다면 false를 반환한다.false를 반환하는 경우 응용 프로그램은 HTTP 상태 코드 406 "Not Acceptable"로 응답해야 한다. // Accept: text/html req.accepts('html'); // => "html" // Accept: text/*, application/json req.accepts('html'); // => "html" req.accepts('text/html'); // => "text/html" req.accepts(['json', 'text']); // => "json" re.. 2018. 9. 6. 이전 1 다음