:relfileprefix: ../../../
[#3A559C44821497572AE406FD7CB5C63F285809F2]

= Function url_view_base::port

pass:v,q[Return the port]


== Synopsis

Declared in header `</boost/url/url_view_base.hpp#L1526[boost/url/url_view_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
string_view
port() const noexcept;
----

== Description

pass:v,q[If present, this function returns a] pass:v,q[string representing the port (which]
pass:v,q[may be empty).]
pass:v,q[Otherwise it returns an empty string.]

=== Example
[,cpp]
----
assert( url_view( "http://localhost.com:8080" ).port() == "8080" );
----

=== Complexity
pass:v,q[Constant.]

=== Exception Safety
pass:v,q[Throws nothing.]

=== BNF
[,cpp]
----
port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)]



== Return Value

* `string_view` 




