c# - Changing the scheme of System.Uri -
i'm looking canonical way of changing scheme of given system.uri instance system.uribuilder without crappy string manipulations , magic constants. have
var uri = new uri("http://localhost/hello")
and need change 'https'. issue in limited uribuilder
ctors , uri.port
defaulting 80 (should change 443? hardcoding?). code must respect uri
properties such possible basic auth credentials, query string, etc.
ended one:
var uribuilder = new uribuilder(requesturl) { scheme = uri.urischemehttps, port = -1 // default port scheme };
Comments
Post a Comment