Skip to content

Commit c4af0f4

Browse files
committed
Merge branch 'more-tests' into dev
2 parents 8b388fb + e15bc71 commit c4af0f4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/RestSharp/Enum.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public enum DataFormat { Json, Xml, None }
3434
/// </summary>
3535
public enum Method {
3636
Get, Post, Put, Delete, Head, Options,
37-
Patch, Merge, Copy
37+
Patch, Merge, Copy, Search
3838
}
3939

4040
/// <summary>

src/RestSharp/Parameters/ParametersCollection.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ public bool Exists(Parameter parameter)
5454

5555
internal ParametersCollection GetQueryParameters(Method method) {
5656
Func<Parameter, bool> condition =
57-
!IsPostStyle(method)
57+
!IsPost(method)
5858
? p => p.Type is ParameterType.GetOrPost or ParameterType.QueryString
5959
: p => p.Type is ParameterType.QueryString;
6060

6161
return new ParametersCollection(_parameters.Where(p => condition(p)));
6262
}
6363

6464
internal ParametersCollection? GetContentParameters(Method method)
65-
=> !IsPostStyle(method) ? null : new ParametersCollection(GetParameters<GetOrPostParameter>());
65+
=> IsPost(method) ? new ParametersCollection(GetParameters<GetOrPostParameter>()) : null;
6666

67-
static bool IsPostStyle(Method method) => method is Method.Post or Method.Put or Method.Patch;
67+
static bool IsPost(Method method) => method is Method.Post or Method.Put or Method.Patch;
6868

6969
public IEnumerator<Parameter> GetEnumerator() => _parameters.GetEnumerator();
7070

src/RestSharp/RestClient.Async.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ static HttpMethod AsHttpMethod(Method method)
182182
#else
183183
Method.Patch => HttpMethod.Patch,
184184
#endif
185-
Method.Merge => new HttpMethod("MERGE"),
186-
Method.Copy => new HttpMethod("COPY"),
187-
_ => throw new ArgumentOutOfRangeException()
185+
Method.Merge => new HttpMethod("MERGE"),
186+
Method.Copy => new HttpMethod("COPY"),
187+
Method.Search => new HttpMethod("SEARCH"),
188+
_ => throw new ArgumentOutOfRangeException()
188189
};
189190
}

0 commit comments

Comments
 (0)