cowboy_req.path.asciidoc 869 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. = cowboy_req:path(3)
  2. == Name
  3. cowboy_req:path - URI path
  4. == Description
  5. [source,erlang]
  6. ----
  7. path(Req :: cowboy_req:req()) -> Path :: binary()
  8. ----
  9. Return the path of the effective request URI.
  10. The path can also be obtained using pattern matching:
  11. [source,erlang]
  12. ----
  13. #{path := Path} = Req.
  14. ----
  15. == Arguments
  16. Req::
  17. The Req object.
  18. == Return value
  19. The path is returned as a binary string. It is case sensitive.
  20. == Changelog
  21. * *2.0*: Only the path is returned, it is no longer wrapped in a tuple.
  22. * *1.0*: Function introduced.
  23. == Examples
  24. .Get the effective request URI's path
  25. [source,erlang]
  26. ----
  27. Path = cowboy_req:path(Req).
  28. ----
  29. == See also
  30. link:man:cowboy_req(3)[cowboy_req(3)],
  31. link:man:cowboy_req:binding(3)[cowboy_req:binding(3)],
  32. link:man:cowboy_req:bindings(3)[cowboy_req:bindings(3)],
  33. link:man:cowboy_req:path_info(3)[cowboy_req:path_info(3)]