KoaでレスポンスのContent-Typeを取得する方法を紹介する。
ctx.response.type
で取得できる
ctx.response.type // "text/html"
これは、charset
などのパラメータを除いた部分になる。
参考
- koa/response.md at master · koajs/koa - 公式ドキュメント
Go to list of users who liked
More than 5 years have passed since last update.
KoaでレスポンスのContent-Typeを取得する方法を紹介する。
ctx.response.type
で取得できるctx.response.type // "text/html"
これは、charset
などのパラメータを除いた部分になる。
Register as a new user and use Qiita more conveniently
Go to list of users who liked