namespace BytecodeApi.Rest;
///
/// Represents a REST client that is not tied to a specific API. This class can be used to perform singular HTTP requests that have no API context.
///
public class GenericRestClient : RestClient
{
///
/// Represents a singleton instance. Changes to properties of this object are global.
///
public static GenericRestClient Instance { get; }
///
/// A object with options for REST requests.
///
new public RestRequestOptions RequestOptions
{
get => base.RequestOptions;
set => base.RequestOptions = value;
}
///
/// Gets the that is used to process requests.
///
new public HttpClient HttpClient => base.HttpClient;
static GenericRestClient()
{
Instance = new();
}
///
/// Initializes a new instance of the class.
///
public GenericRestClient() : base("")
{
}
///
/// Performs a GET request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Get(string url)
{
return base.Get(url);
}
///
/// Performs a POST request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Post(string url)
{
return base.Post(url);
}
///
/// Performs a PUT request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Put(string url)
{
return base.Put(url);
}
///
/// Performs a PATCH request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Patch(string url)
{
return base.Patch(url);
}
///
/// Performs a DELETE request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Delete(string url)
{
return base.Delete(url);
}
///
/// Performs a PURGE request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Purge(string url)
{
return base.Purge(url);
}
///
/// Performs a HEAD request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Head(string url)
{
return base.Head(url);
}
///
/// Performs a OPTIONS request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Options(string url)
{
return base.Options(url);
}
///
/// Performs a TRACE request on the specified URL.
///
/// The URL to perform the request on.
///
/// A object to be used to further refine, and then send the request.
///
new public RestRequest Trace(string url)
{
return base.Trace(url);
}
}