Skip to content

Commit 641f428

Browse files
committed
Added the configurator method to the interface
Build should be Release Added some XML docs
1 parent 0cd360a commit 641f428

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

RestSharp.Tests/InterfaceImplementationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void IRestSharp_Has_All_RestSharp_Signatures()
2525
restClientImplementationType.FullName, restClientInterfaceType.FullName));
2626

2727
// Assert
28-
Assert.AreEqual(0, compareResult.Count());
28+
Assert.AreEqual(0, compareResult.Count);
2929
}
3030

3131
private static IEnumerable<string> CompareTypes(IReflect type1, IReflect type2, BindingFlags bindingFlags)

RestSharp/IRestClient.cs

+18
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,28 @@ RestRequestAsyncHandle ExecuteAsyncGet<T>(IRestRequest request, Action<IRestResp
138138
RestRequestAsyncHandle ExecuteAsyncPost<T>(IRestRequest request, Action<IRestResponse<T>,
139139
RestRequestAsyncHandle> callback, string httpMethod);
140140

141+
/// <summary>
142+
/// Add a delegate to apply custom configuration to HttpWebRequest before making a call
143+
/// </summary>
144+
/// <param name="configurator">Configuration delegate for HttpWebRequest</param>
145+
void ConfigureWebRequest(Action<HttpWebRequest> configurator);
146+
147+
/// <summary>
148+
/// Adds or replaces a deserializer for the specified content type
149+
/// </summary>
150+
/// <param name="contentType">Content type for which the deserializer will be replaced</param>
151+
/// <param name="deserializer">Custom deserializer</param>
141152
void AddHandler(string contentType, IDeserializer deserializer);
142153

154+
/// <summary>
155+
/// Removes custom deserialzier for the specified content type
156+
/// </summary>
157+
/// <param name="contentType">Content type for which deserializer needs to be removed</param>
143158
void RemoveHandler(string contentType);
144159

160+
/// <summary>
161+
/// Remove deserializers for all content types
162+
/// </summary>
145163
void ClearHandlers();
146164

147165
IRestResponse ExecuteAsGet(IRestRequest request, string httpMethod);

RestSharp/RestClient.cs

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public RestClient()
7171
FollowRedirects = true;
7272
}
7373

74+
/// <inheritdoc />
7475
/// <summary>
7576
/// Sets the BaseUrl property for requests made by this client instance
7677
/// </summary>
@@ -80,6 +81,7 @@ public RestClient(Uri baseUrl) : this()
8081
BaseUrl = baseUrl;
8182
}
8283

84+
/// <inheritdoc />
8385
/// <summary>
8486
/// Sets the BaseUrl property for requests made by this client instance
8587
/// </summary>

build.bat

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
msbuild.exe /t:restore
2-
msbuild.exe /t:build
1+
dotnet msbuild /p:Configuration=Release
32
dotnet test --no-build
4-
msbuild.exe /t:pack /p:Version=106.0.0
3+
dotnet msbuild /t:Pack /p:Version=106.0.0

0 commit comments

Comments
 (0)