classafBedSheet::HttpRequestBody

sys::Obj
  afBedSheet::HttpRequestBody

Convenience methods for accessing the request body.

buf

Source

Buf? buf()

Returns the request body as a Buf. Returns null if there is no request content.

form

Source

[Str:Str]? 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 HttpStatus Err is thrown with a status code of 400 - Bad Request.

in

Source

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 return null.

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

Source

[Str:Obj?]? jsonMap()

Returns the request body as a JSON Map. Convenience for ([Str:Obj?]?) body.jsonObj().

jsonObj

Source

Obj? jsonObj()

Returns the request body as a JSON Obj. Parsing is done with util::JsonInStream If the JSON is invalid, a HttpStatus Err is thrown with a status code of 400 - Bad Request. Returns null if there is no request content.

str

Source

Str? str()

Returns the request body as a Str. Returns null if there is no request content.