IHttpClient.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.IO;
  2. using System.Threading.Tasks;
  3. namespace MediaBrowser.Common.Net
  4. {
  5. /// <summary>
  6. /// Interface IHttpClient
  7. /// </summary>
  8. public interface IHttpClient
  9. {
  10. /// <summary>
  11. /// Gets the response.
  12. /// </summary>
  13. /// <param name="options">The options.</param>
  14. /// <returns>Task{HttpResponseInfo}.</returns>
  15. Task<HttpResponseInfo> GetResponse(HttpRequestOptions options);
  16. /// <summary>
  17. /// Gets the specified options.
  18. /// </summary>
  19. /// <param name="options">The options.</param>
  20. /// <returns>Task{Stream}.</returns>
  21. Task<Stream> Get(HttpRequestOptions options);
  22. /// <summary>
  23. /// Sends the asynchronous.
  24. /// </summary>
  25. /// <param name="options">The options.</param>
  26. /// <param name="httpMethod">The HTTP method.</param>
  27. /// <returns>Task{HttpResponseInfo}.</returns>
  28. Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
  29. /// <summary>
  30. /// Posts the specified options.
  31. /// </summary>
  32. /// <param name="options">The options.</param>
  33. /// <returns>Task{HttpResponseInfo}.</returns>
  34. Task<HttpResponseInfo> Post(HttpRequestOptions options);
  35. /// <summary>
  36. /// Downloads the contents of a given url into a temporary location
  37. /// </summary>
  38. /// <param name="options">The options.</param>
  39. /// <returns>Task{System.String}.</returns>
  40. /// <exception cref="System.ArgumentNullException">progress</exception>
  41. /// <exception cref="Model.Net.HttpException"></exception>
  42. Task<string> GetTempFile(HttpRequestOptions options);
  43. /// <summary>
  44. /// Gets the temporary file response.
  45. /// </summary>
  46. /// <param name="options">The options.</param>
  47. /// <returns>Task{HttpResponseInfo}.</returns>
  48. Task<HttpResponseInfo> GetTempFileResponse(HttpRequestOptions options);
  49. }
  50. }