classafBedSheet::HttpRequestBody
sys::Obj afBedSheet::HttpRequestBody
Convenience methods for accessing the request body.
- buf
Buf? buf()
Returns the request body as a
Buf
. Returnsnull
if there is no request content.- form
Get the request body as a form of key / value pairs. The form is parsed using sys::Uri.decodeQuery.
If the form data is invalid, a
HttpStatusErr
is thrown with a status code of400 - Bad Request
.- in
InStream? in()
Returns the request body as an
InStream
. See web::WebUtil.makeContentInStream to check under which conditions request content is available. If request content is not available, then returnnull
.If the client specified the "Expect: 100-continue" header, then the first access of the request input stream will automatically send the client a
100 Continue
response.@see web::WebReq.in
- jsonMap
Returns the request body as a JSON Map. Convenience for
([Str:Obj?]?) body.jsonObj()
.- jsonObj
Obj? jsonObj()
Returns the request body as a JSON Obj. Parsing is done with util::JsonInStream If the JSON is invalid, a
HttpStatusErr
is thrown with a status code of400 - Bad Request
. Returnsnull
if there is no request content.- str
Str? str()
Returns the request body as a
Str
. Returnsnull
if there is no request content.