mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 03:50:08 -07:00
moved everything up a directory
This commit is contained in:
parent
448cd8d92e
commit
9a78f790a6
76 changed files with 0 additions and 0 deletions
|
@ -1,41 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using RequestPlex.Api.Interfaces;
|
||||
|
||||
using RestSharp;
|
||||
|
||||
namespace RequestPlex.Api
|
||||
{
|
||||
public class ApiRequest : IApiRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// An API request handler
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of class you want to deserialize</typeparam>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <param name="baseUri">The base URI.</param>
|
||||
/// <returns>The type of class you want to deserialize</returns>
|
||||
public T Execute<T>(IRestRequest request, Uri baseUri) where T : new()
|
||||
{
|
||||
var client = new RestClient { BaseUrl = baseUri };
|
||||
|
||||
var response = client.Execute<T>(request);
|
||||
|
||||
if (response.ErrorException != null)
|
||||
{
|
||||
|
||||
|
||||
var message = "Error retrieving response. Check inner details for more info.";
|
||||
throw new ApplicationException(message, response.ErrorException);
|
||||
}
|
||||
|
||||
return response.Data;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue