Skip to content

Commit

Permalink
ResponseUri property from HttpWebResponse should be exposed in the in…
Browse files Browse the repository at this point in the history
…terface

Technically a breaking change, but only for code actually implementing the IHttpResponse interface
  • Loading branch information
abjerner committed Jun 19, 2019
1 parent e13fc53 commit 5f35656
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/Skybrud.Essentials.Http/HttpResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -52,6 +53,11 @@ public class HttpResponse : IHttpResponse {
/// </summary>
public IHttpHeaderCollection Headers => _headers ?? (_headers = new HttpHeaderCollection(Response.Headers));

/// <summary>
/// Gets the URI of the response (eg. if the request was redirected).
/// </summary>
public Uri ResponseUri => Response.ResponseUri;

/// <summary>
/// Gets a reference to the <see cref="Encoding"/>. The underlying <see cref="HttpWebResponse"/> doesn't
/// explicitly expode the encoding of the response, so the value of this property is a "best guess" based on
Expand Down
8 changes: 7 additions & 1 deletion src/Skybrud.Essentials.Http/IHttpResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Net;
using System;
using System.Net;
using Skybrud.Essentials.Http.Collections;

namespace Skybrud.Essentials.Http {
Expand Down Expand Up @@ -38,6 +39,11 @@ public interface IHttpResponse {
/// </summary>
IHttpHeaderCollection Headers { get; }

/// <summary>
/// Gets the URI of the response (eg. if the request was redirected).
/// </summary>
Uri ResponseUri { get; }

/// <summary>
/// Gets the response body as a raw string.
/// </summary>
Expand Down

0 comments on commit 5f35656

Please sign in to comment.