mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
Make IResponse.ContentType readonly
This commit is contained in:
@@ -88,12 +88,11 @@ namespace Octokit.Internal
|
||||
}
|
||||
}
|
||||
|
||||
return new Response(responseMessage.Headers.ToDictionary(h => h.Key, h => h.Value.First()))
|
||||
{
|
||||
Body = responseBody,
|
||||
StatusCode = responseMessage.StatusCode,
|
||||
ContentType = contentType,
|
||||
};
|
||||
return new Response(
|
||||
responseMessage.StatusCode,
|
||||
responseBody,
|
||||
responseMessage.Headers.ToDictionary(h => h.Key, h => h.Value.First()),
|
||||
contentType);
|
||||
}
|
||||
|
||||
protected virtual HttpRequestMessage BuildRequestMessage(IRequest request)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using Octokit.Internal;
|
||||
|
||||
namespace Octokit.Internal
|
||||
@@ -19,10 +21,21 @@ namespace Octokit.Internal
|
||||
ApiInfo = ApiInfoParser.ParseResponseHeaders(headers);
|
||||
}
|
||||
|
||||
public Response(HttpStatusCode statusCode, object body, IDictionary<string, string> headers, string contentType)
|
||||
{
|
||||
Ensure.ArgumentNotNull(headers, "headers");
|
||||
|
||||
StatusCode = statusCode;
|
||||
Body = body;
|
||||
Headers = headers;
|
||||
ApiInfo = ApiInfoParser.ParseResponseHeaders(headers);
|
||||
ContentType = contentType;
|
||||
}
|
||||
|
||||
public object Body { get; set; }
|
||||
public IDictionary<string, string> Headers { get; private set; }
|
||||
public ApiInfo ApiInfo { get; private set; }
|
||||
public HttpStatusCode StatusCode { get; set; }
|
||||
public string ContentType { get; set; }
|
||||
public string ContentType { get; private set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user