11using System ;
22using System . Net . Http ;
3+ using System . Net . Http . Headers ;
34using System . Text ;
45using System . Threading . Tasks ;
56using GraphQL . Common . Request ;
@@ -13,6 +14,14 @@ namespace GraphQL.Client {
1314 /// </summary>
1415 public partial class GraphQLClient : IDisposable {
1516
17+ #region Properties
18+
19+ /// <summary>
20+ /// Gets the headers which should be sent with each request.
21+ /// </summary>
22+ public HttpRequestHeaders DefaultRequestHeaders =>
23+ this . httpClient . DefaultRequestHeaders ;
24+
1625 /// <summary>
1726 /// The GraphQL EndPoint to be used
1827 /// </summary>
@@ -26,6 +35,8 @@ public Uri EndPoint {
2635 /// </summary>
2736 public GraphQLClientOptions Options { get ; set ; }
2837
38+ #endregion
39+
2940 private readonly HttpClient httpClient ;
3041
3142 #region Constructors
@@ -135,6 +146,12 @@ public async Task<GraphQLResponse> PostAsync(GraphQLRequest request) {
135146 return await this . ReadHttpResponseMessageAsync ( httpResponseMessage ) . ConfigureAwait ( false ) ;
136147 }
137148
149+ /// <summary>
150+ /// Releases unmanaged resources
151+ /// </summary>
152+ public void Dispose ( ) =>
153+ this . httpClient . Dispose ( ) ;
154+
138155 /// <summary>
139156 /// Reads the <see cref="HttpResponseMessage"/>
140157 /// </summary>
@@ -145,12 +162,6 @@ private async Task<GraphQLResponse> ReadHttpResponseMessageAsync(HttpResponseMes
145162 return JsonConvert . DeserializeObject < GraphQLResponse > ( resultString , this . Options . JsonSerializerSettings ) ;
146163 }
147164
148- /// <summary>
149- /// Releases unmanaged resources
150- /// </summary>
151- public void Dispose ( ) =>
152- this . httpClient . Dispose ( ) ;
153-
154165 }
155166
156167}
0 commit comments