text: (window.webpackJsonp=window.webpackJsonp||[]).push([[249],{621:function(t,a,e){"use strict";e.r(a);var r=e(42),s=Object(r.a)({},(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"bodydecoder-hpp"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-hpp"}},[t._v("#")]),t._v(" BodyDecoder.hpp"),e("seo")],1),t._v(" "),e("p",[e("a",{attrs:{href:"https://github.com/oatpp/oatpp/blob/master/src/oatpp/web/protocol/http/incoming/BodyDecoder.hpp",target:"_blank",rel:"noopener noreferrer"}},[t._v("This File On Github"),e("OutboundLink")],1),e("br"),t._v(" "),e("a",{attrs:{href:"https://github.com/oatpp/oatpp/issues/new?title=API%20question&body=In%20file:%20oatpp/web/protocol/http/incoming/BodyDecoder.hpp%0A%0A%23%20Question%0A%0A%3Cyour-question-here%3E",target:"_blank",rel:"noopener noreferrer"}},[t._v("Ask A Question"),e("OutboundLink")],1)]),t._v(" "),e("p",[e("code",[t._v("API: latest")]),e("br"),t._v(" "),e("code",[t._v("module: oatpp")]),e("br"),t._v(" "),e("code",[t._v('#include "oatpp/web/protocol/http/incoming/BodyDecoder.hpp"')])]),t._v(" "),e("h2",{attrs:{id:"bodydecoder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder"}},[t._v("#")]),t._v(" BodyDecoder")]),t._v(" "),e("p",[t._v('Abstract BodyDecoder. Body Decoder is responsible to decode body of incoming request. For example if you receive chunked-encoded body, you have to decode it in order to get "plain" body. You may extend this class in order to customize body-decoding process.')]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" oatpp "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" web "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" protocol "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" http "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" incoming "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n  "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BodyDecoder")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"methods"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Return Type")]),t._v(" "),e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Summary")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("[none]")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-~bodydecoder"}},[t._v("~BodyDecoder")])]),t._v(" "),e("td",[t._v("Virtual destructor.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("void")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decode"}},[t._v("decode")])]),t._v(" "),e("td",[t._v("Implement this method! Decode bodyStream and write decoded data to toStream.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("oatpp::async::CoroutineStarter")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decodeasync"}},[t._v("decodeAsync")])]),t._v(" "),e("td",[t._v("Implement this method! Same as "),e("a",{attrs:{href:"#bodydecoder-decode"}},[t._v("BodyDecoder::decode()")]),t._v(" but Async.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("oatpp::String")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decodetostring"}},[t._v("decodeToString")])]),t._v(" "),e("td",[t._v("Read body stream and decode it to string.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("Wrapper")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decodetodto"}},[t._v("decodeToDto")])]),t._v(" "),e("td",[t._v("Read body stream, decode, and deserialize it as DTO Object (see "),e("a",{attrs:{href:"https://oatpp.io/docs/components/dto/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Transfer Object (DTO)"),e("OutboundLink")],1),t._v(").")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("oatpp::async::CoroutineStarterForResult<const oatpp::String&>")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decodetostringasync"}},[t._v("decodeToStringAsync")])]),t._v(" "),e("td",[t._v("Same as "),e("a",{attrs:{href:"#bodydecoder-decodetostring"}},[t._v("BodyDecoder::decodeToString()")]),t._v(" but Async.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("oatpp::async::CoroutineStarterForResult<const Wrapper&>")])]),t._v(" "),e("td",[e("a",{attrs:{href:"#bodydecoder-decodetodtoasync"}},[t._v("decodeToDtoAsync")])]),t._v(" "),e("td",[t._v("Same as "),e("a",{attrs:{href:"#bodydecoder-decodetodto"}},[t._v("BodyDecoder::decodeToDto()")]),t._v(" but Async.")])])])]),t._v(" "),e("h3",{attrs:{id:"bodydecoder-bodydecoder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-bodydecoder"}},[t._v("#")]),t._v(" BodyDecoder::~BodyDecoder")]),t._v(" "),e("p",[t._v("Virtual destructor.")]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("virtual")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("~")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BodyDecoder")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decode"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decode"}},[t._v("#")]),t._v(" BodyDecoder::decode")]),t._v(" "),e("p",[t._v("Implement this method! Decode bodyStream and write decoded data to toStream. "),e("ul",[e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - pointer to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" writeCallback - "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#writecallback"}},[t._v("oatpp::data::stream::WriteCallback")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")])])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("virtual")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("WriteCallback"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" writeCallback"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decodeasync"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decodeasync"}},[t._v("#")]),t._v(" BodyDecoder::decodeAsync")]),t._v(" "),e("p",[t._v("Implement this method! Same as "),e("a",{attrs:{href:"#bodydecoder-decode"}},[t._v("BodyDecoder::decode()")]),t._v(" but Async. "),e("ul",[e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - "),e("code",[t._v("std::shared_ptr")]),t._v(" to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" writeCallback - "),e("code",[t._v("std::shared_ptr")]),t._v(" to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#writecallback"}},[t._v("oatpp::data::stream::WriteCallback")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")]),e("li",[e("strong",[t._v("@return")]),t._v(" - "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/async/Coroutine/#coroutinestarter"}},[t._v("oatpp::async::CoroutineStarter")]),t._v(". ")],1)])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("virtual")]),t._v(" oatpp"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("async"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("CoroutineStarter "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decodeAsync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                                                   "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                                                   "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("WriteCallback"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" writeCallback"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                                                   "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decodetostring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decodetostring"}},[t._v("#")]),t._v(" BodyDecoder::decodeToString")]),t._v(" "),e("p",[t._v("Read body stream and decode it to string. "),e("ul",[e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - pointer to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")]),e("li",[e("strong",[t._v("@return")]),t._v(" - oatpp::String;. ")])])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[t._v("oatpp"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decodeToString")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                             data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                             data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decodetodto"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decodetodto"}},[t._v("#")]),t._v(" BodyDecoder::decodeToDto")]),t._v(" "),e("p",[t._v("Read body stream, decode, and deserialize it as DTO Object (see "),e("a",{attrs:{href:"https://oatpp.io/docs/components/dto/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Data Transfer Object (DTO)"),e("OutboundLink")],1),t._v("). "),e("ul",[e("li",[e("strong",[t._v("@tparam")]),t._v(" Wrapper - ObjectWrapper type. ")]),e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - pointer to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")]),e("li",[e("strong",[t._v("@param")]),t._v(" objectMapper - pointer to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/mapping/ObjectMapper/#objectmapper"}},[t._v("oatpp::data::mapping::ObjectMapper")]),t._v(". ")],1),e("li",[e("strong",[t._v("@return")]),t._v(" - deserialized DTO object. ")])])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("template")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wrapper")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\nWrapper "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decodeToDto")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("mapping"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("ObjectMapper"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" objectMapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decodetostringasync"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decodetostringasync"}},[t._v("#")]),t._v(" BodyDecoder::decodeToStringAsync")]),t._v(" "),e("p",[t._v("Same as "),e("a",{attrs:{href:"#bodydecoder-decodetostring"}},[t._v("BodyDecoder::decodeToString()")]),t._v(" but Async. "),e("ul",[e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - "),e("code",[t._v("std::shared_ptr")]),t._v(" to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")]),e("li",[e("strong",[t._v("@return")]),t._v(" - oatpp::async::CoroutineStarterForResult. ")])])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[t._v("oatpp"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("async"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("CoroutineStarterForResult"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" oatpp"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decodeToStringAsync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                    "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v("\n")])])]),e("h3",{attrs:{id:"bodydecoder-decodetodtoasync"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bodydecoder-decodetodtoasync"}},[t._v("#")]),t._v(" BodyDecoder::decodeToDtoAsync")]),t._v(" "),e("p",[t._v("Same as "),e("a",{attrs:{href:"#bodydecoder-decodetodto"}},[t._v("BodyDecoder::decodeToDto()")]),t._v(" but Async. "),e("ul",[e("li",[e("strong",[t._v("@tparam")]),t._v(" Wrapper - ObjectWrapper type. ")]),e("li",[e("strong",[t._v("@param")]),t._v(" headers - Headers map. "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/Http/#headers"}},[t._v("oatpp::web::protocol::http::Headers")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" bodyStream - "),e("code",[t._v("std::shared_ptr")]),t._v(" to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/stream/Stream/#inputstream"}},[t._v("oatpp::data::stream::InputStream")]),t._v(". ")],1),e("li",[e("strong",[t._v("@param")]),t._v(" connection ")]),e("li",[e("strong",[t._v("@param")]),t._v(" objectMapper - "),e("code",[t._v("std::shared_ptr")]),t._v(" to "),e("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/mapping/ObjectMapper/#objectmapper"}},[t._v("oatpp::data::mapping::ObjectMapper")]),t._v(". ")],1),e("li",[e("strong",[t._v("@return")]),t._v(" - oatpp::async::CoroutineStarterForResult. ")])])]),t._v(" "),e("div",{staticClass:"language-cpp extra-class"},[e("pre",{pre:!0,attrs:{class:"language-cpp"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("template")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wrapper")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\noatpp"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("async"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("CoroutineStarterForResult"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Wrapper"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decodeToDtoAsync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" headers"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                 "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("InputStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" bodyStream"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                 "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("stream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("IOStream"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" connection"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                 "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("data"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("mapping"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("ObjectMapper"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" objectMapper"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=s.exports}}]);