ogre/origin
Types
pub type Origin {
Origin(
scheme: http.Scheme,
host: String,
port: option.Option(Int),
)
}
Constructors
-
Origin( scheme: http.Scheme, host: String, port: option.Option(Int), )
Values
pub fn from_string(uri: String) -> Result(Origin, Nil)
pub fn from_string_strict(uri: String) -> Result(Origin, Nil)
Parse an Origin from a string.
Will fail if the string contains a path, query or hash component.
use from_string for loose requirements to extract an origin from any valid url string.
pub fn from_uri_strict(uri: uri.Uri) -> Result(Origin, Nil)
Convert a url representing an origin into an Origin type.
Will fail if the url has any additional components.
use from_url to extract an origin from a url.
pub fn to_request(origin: Origin) -> request.Request(String)