[#boost-urls-url_view_base-encoded_origin]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url&lowbar;view&lowbar;base]::encoded&lowbar;origin
:relfileprefix: ../../../
:mrdocs:


Return the origin

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2227[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/pct_string_view.adoc[pct&lowbar;string&lowbar;view]
encoded&lowbar;origin() const noexcept;
----

== Description


If an authority is present, this        function returns the scheme and        authority portion of the url&period;        Otherwise, an empty string is        returned&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com:8080/index.htm?text=none#h1" ).encoded_origin() == "http://www.example.com:8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== See Also


xref:boost/urls/url_view_base/encoded_resource.adoc[encoded&lowbar;resource],            xref:boost/urls/url_view_base/encoded_target.adoc[encoded&lowbar;target]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
