mirror of
https://github.com/strapi/strapi.git
synced 2025-08-22 15:48:59 +00:00
1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
![]() |
(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{220:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"response"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response","aria-hidden":"true"}},[t._v("#")]),t._v(" Response")]),t._v(" "),a("p",[t._v("A Strapi "),a("code",[t._v("Response")]),t._v(" object is an abstraction on top of Node's vanilla response object,\nproviding additional functionality that is useful for every day HTTP server\ndevelopment.")]),t._v(" "),a("h2",{attrs:{id:"api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api","aria-hidden":"true"}},[t._v("#")]),t._v(" API")]),t._v(" "),a("h3",{attrs:{id:"response-header"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-header","aria-hidden":"true"}},[t._v("#")]),t._v(" response.header")]),t._v(" "),a("p",[t._v("Response header object.")]),t._v(" "),a("h3",{attrs:{id:"response-headers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-headers","aria-hidden":"true"}},[t._v("#")]),t._v(" response.headers")]),t._v(" "),a("p",[t._v("Response header object. Alias as "),a("code",[t._v("response.header")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"response-socket"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-socket","aria-hidden":"true"}},[t._v("#")]),t._v(" response.socket")]),t._v(" "),a("p",[t._v("Request socket.")]),t._v(" "),a("h3",{attrs:{id:"response-status"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-status","aria-hidden":"true"}},[t._v("#")]),t._v(" response.status")]),t._v(" "),a("p",[t._v("Get response status. By default, "),a("code",[t._v("response.status")]),t._v(" is not set unlike Node's\n"),a("code",[t._v("res.statusCode")]),t._v(" which defaults to "),a("code",[t._v("200")]),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"response-status-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-status-2","aria-hidden":"true"}},[t._v("#")]),t._v(" response.status=")]),t._v(" "),a("p",[t._v("Set response status via numeric code:")]),t._v(" "),a("ul",[a("li",[t._v('100 "continue"')]),t._v(" "),a("li",[t._v('101 "switching protocols"')]),t._v(" "),a("li",[t._v('102 "processing"')]),t._v(" "),a("li",[t._v('200 "ok"')]),t._v(" "),a("li",[t._v('201 "created"')]),t._v(" "),a("li",[t._v('202 "accepted"')]),t._v(" "),a("li",[t._v('203 "non-authoritative information"')]),t._v(" "),a("li",[t._v('204 "no content"')]),t._v(" "),a("li",[t._v('205 "reset content"')]),t._v(" "),a("li",[t._v('206 "partial content"')]),t._v(" "),a("li",[t._v('207 "multi-status"')]),t._v(" "),a("li",[t._v('300 "multiple choices"')]),t._v(" "),a("li",[t._v('301 "moved permanently"')]),t._v(" "),a("li",[t._v('302 "moved temporarily"')]),t._v(" "),a("li",[t._v('303 "see other"')]),t._v(" "),a("li",[t._v('304 "not modified"')]),t._v(" "),a("li",[t._v('305 "use proxy"')]),t._v(" "),a("li",[t._v('307 "temporary redirect"')]),t._v(" "),a("li",[t._v('400 "bad request"')]),t._v(" "),a("li",[t._v('401 "unauthorized"')]),t._v(" "),a("li",[t._v('402 "payment required"')]),t._v(" "),a("li",[t._v('403 "forbidden"')]),t._v(" "),a("li",[t._v('404 "not found"')]),t._v(" "),a("li",[t._v('405 "method not allowed"')]),t._v(" "),a("li",[t._v('406 "not acceptable"')]),t._v(" "),a("li",[t._v('407 "proxy authentication required"')]),t._v(" "),a("li",[t._v('408 "request time-out"')]),t._v(" "),a("li",[t._v('409 "conflict"')]),t._v(" "),a("li",[t._v('410 "gone"')]),t._v(" "),a("li",[t._v('411 "length required"')]),t._v(" "),a("li",[t._v('412 "precondition failed"')]),t._v(" "),a("li",[t._v('413 "request entity too large"')]),t._v(" "),a("li",[t._v('414 "request-uri too large"')]),t._v(" "),a("li",[t._v('415 "unsupported media type"')]),t._v(" "),a("li",[t._v('416 "requested range not satisfiable"')]),t._v(" "),a("li",[t._v('417 "expectation failed"')]),t._v(" "),a("li",[t._v('418 "i\'m a teapot"')]),t._v(" "),a("li",[t._v('422 "unprocessable entit
|