Table of Contents

Class HttpUtil

Namespace
Hi.Common.PathUtils
Assembly
HiGeom.dll

Utility class for HTTP operations such as URL validation and content retrieval.

public static class HttpUtil
Inheritance
HttpUtil
Inherited Members

Methods

ReadAllLinesFromUrl(string)

Reads all lines from a URL's content.

public static string[] ReadAllLinesFromUrl(string url)

Parameters

url string

The URL to read from

Returns

string[]

An array of strings containing the lines from the URL content, or an empty array if the request fails

ReadAllLinesFromUrlAsync(string)

Asynchronously reads all lines from a URL's content.

public static Task<string[]> ReadAllLinesFromUrlAsync(string url)

Parameters

url string

The URL to read from

Returns

Task<string[]>

A task that represents the asynchronous operation. The task result contains an array of strings with the lines from the URL content, or an empty array if the request fails

UrlExists(string)

Checks if a URL exists by making a HEAD request.

public static bool UrlExists(string url)

Parameters

url string

The URL to check

Returns

bool

True if the URL exists and returns a success status code; otherwise, false

UrlExistsAsync(string)

Asynchronously checks if a URL exists by making a HEAD request.

public static Task<bool> UrlExistsAsync(string url)

Parameters

url string

The URL to check

Returns

Task<bool>

A task that represents the asynchronous operation. The task result contains true if the URL exists and returns a success status code; otherwise, false