cowboy_req.has_body.asciidoc 853 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. = cowboy_req:has_body(3)
  2. == Name
  3. cowboy_req:has_body - Is there a request body?
  4. == Description
  5. [source,erlang]
  6. ----
  7. has_body(Req :: cowboy_req:req()) -> boolean()
  8. ----
  9. Return whether the request has a body.
  10. == Arguments
  11. Req::
  12. The Req object.
  13. == Return value
  14. A boolean indicating whether the request has a body.
  15. == Changelog
  16. * *1.0*: Function introduced.
  17. == Examples
  18. .Ensure the request has a body
  19. [source,erlang]
  20. ----
  21. true = cowboy_req:has_body(Req).
  22. ----
  23. == See also
  24. link:man:cowboy_req(3)[cowboy_req(3)],
  25. link:man:cowboy_req:body_length(3)[cowboy_req:body_length(3)],
  26. link:man:cowboy_req:read_body(3)[cowboy_req:read_body(3)],
  27. link:man:cowboy_req:read_urlencoded_body(3)[cowboy_req:read_urlencoded_body(3)],
  28. link:man:cowboy_req:read_part(3)[cowboy_req:read_part(3)],
  29. link:man:cowboy_req:read_part_body(3)[cowboy_req:read_part_body(3)]