Show / Hide Table of Contents

Class HttpEndPoint

Represents HTTP endpoint.

Inheritance
object
EndPoint
DnsEndPoint
HttpEndPoint
Implements
ISupplier<UriBuilder>
IFunctional
IEquatable<HttpEndPoint>
IEqualityOperators<HttpEndPoint, HttpEndPoint, bool>
ISpanFormattable
IFormattable
IParsable<HttpEndPoint>
IUtf8SpanFormattable
Inherited Members
DnsEndPoint.Host
DnsEndPoint.AddressFamily
DnsEndPoint.Port
EndPoint.Serialize()
EndPoint.Create(SocketAddress)
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Net.Http
Assembly: DotNext.dll
Syntax
public sealed class HttpEndPoint : DnsEndPoint, ISupplier<UriBuilder>, IFunctional, IEquatable<HttpEndPoint>, IEqualityOperators<HttpEndPoint?, HttpEndPoint?, bool>, ISpanFormattable, IFormattable, IParsable<HttpEndPoint>, IUtf8SpanFormattable

Constructors

View Source

HttpEndPoint(IPAddress, int, bool)

Initializes a new HTTP endpoint.

Declaration
public HttpEndPoint(IPAddress address, int port, bool secure)
Parameters
Type Name Description
IPAddress address

The address of the endpoint.

int port

The port number associated with the address, or 0 to specify any available port.

bool secure

true for HTTPS; false for HTTP.

View Source

HttpEndPoint(IPEndPoint, bool)

Initializes a new HTTP endpoint.

Declaration
public HttpEndPoint(IPEndPoint address, bool secure)
Parameters
Type Name Description
IPEndPoint address

The address of the endpoint.

bool secure

true for HTTPS; false for HTTP.

View Source

HttpEndPoint(string, int, bool, AddressFamily)

Initializes a new HTTP endpoint.

Declaration
public HttpEndPoint(string hostName, int port, bool secure, AddressFamily family = AddressFamily.Unspecified)
Parameters
Type Name Description
string hostName

The host name or a string representation of the IP address.

int port

The port number associated with the address, or 0 to specify any available port.

bool secure

true for HTTPS; false for HTTP.

AddressFamily family

The type of the host name.

View Source

HttpEndPoint(Uri)

Initializes a new HTTP endpoint.

Declaration
public HttpEndPoint(Uri uri)
Parameters
Type Name Description
Uri uri

The absolute path to Web resource.

Properties

View Source

IsSecure

Gets a value indicating that HTTP over TLS should be used (HTTPS).

Declaration
public bool IsSecure { get; }
Property Value
Type Description
bool
View Source

Scheme

Gets URI scheme.

Declaration
public string Scheme { get; }
Property Value
Type Description
string

Methods

View Source

CreateUriBuilder()

Creates a new instance of System.UriBuilder with host, port and scheme imported from this object.

Declaration
public UriBuilder CreateUriBuilder()
Returns
Type Description
UriBuilder

A new instance of System.UriBuilder.

View Source

Equals(HttpEndPoint?)

Determines whether this object represents the same HTTP endpoint as the specified object.

Declaration
public bool Equals(HttpEndPoint? other)
Parameters
Type Name Description
HttpEndPoint other

The object to compare.

Returns
Type Description
bool

true if this object represents the same endpoint as other; otherwise, false.

View Source

Equals(object?)

Determines whether this object represents the same HTTP endpoint as the specified object.

Declaration
public override bool Equals(object? other)
Parameters
Type Name Description
object other

The object to compare.

Returns
Type Description
bool

true if this object represents the same endpoint as other; otherwise, false.

Overrides
DnsEndPoint.Equals(object)
View Source

GetHashCode()

Gets a hash code of this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

The hash code of this instance.

Overrides
DnsEndPoint.GetHashCode()
View Source

ToString()

Converts endpoint to its string representation.

Declaration
public override string ToString()
Returns
Type Description
string

The string representation of this end point.

Overrides
DnsEndPoint.ToString()
View Source

ToString(string?, IFormatProvider?)

Declaration
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
Type Name Description
string format
IFormatProvider formatProvider
Returns
Type Description
string
View Source

TryParse(string?, out HttpEndPoint?)

Attempts to parse HTTP endpoint.

Declaration
public static bool TryParse(string? str, out HttpEndPoint? result)
Parameters
Type Name Description
string str

The string representing HTTP endpoint.

HttpEndPoint result

The parsed object; or null if parsing failed.

Returns
Type Description
bool

true if parsing is successful; otherwise, false.

Operators

View Source

explicit operator UriBuilder?(HttpEndPoint?)

Creates a new instance of System.UriBuilder with host, port and scheme imported from this object.

Declaration
public static explicit operator UriBuilder?(HttpEndPoint? endPoint)
Parameters
Type Name Description
HttpEndPoint endPoint

The endpoint.

Returns
Type Description
UriBuilder

A new instance of System.UriBuilder.

Explicit Interface Implementations

View Source

operator ==(HttpEndPoint?, HttpEndPoint?)

Determines whether the objects represent the same HTTP endpoint.

Declaration
static bool operator ==(HttpEndPoint? x, HttpEndPoint? y)
Parameters
Type Name Description
HttpEndPoint x

The first object to compare.

HttpEndPoint y

The second object to compare.

Returns
Type Description
bool

true if both objects represent the same endpoint; otherwise, false.

View Source

operator !=(HttpEndPoint?, HttpEndPoint?)

Determines whether the objects represent the different HTTP endpoints.

Declaration
static bool operator !=(HttpEndPoint? x, HttpEndPoint? y)
Parameters
Type Name Description
HttpEndPoint x

The first object to compare.

HttpEndPoint y

The second object to compare.

Returns
Type Description
bool

true if both objects represent the different endpoints; otherwise, false.

Implements

ISupplier<TResult>
IFunctional
IEquatable<T>
IEqualityOperators<TSelf, TOther, TResult>
ISpanFormattable
IFormattable
IParsable<TSelf>
IUtf8SpanFormattable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾