Skip to content

Commit 8ae6235

Browse files
committed
Merge if statements
1 parent a8a31ed commit 8ae6235

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

RestSharp/Http.Sync.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,10 @@ private HttpResponse GetStyleMethodInternal(string method)
111111
{
112112
var webRequest = ConfigureWebRequest(method, Url);
113113

114-
115-
if (method == "DELETE" || method == "OPTIONS")
114+
if (HasBody && (method == "DELETE" || method == "OPTIONS"))
116115
{
117-
if (HasBody)
118-
{
119-
webRequest.ContentType = RequestContentType;
120-
WriteRequestBody(webRequest);
121-
}
116+
webRequest.ContentType = RequestContentType;
117+
WriteRequestBody(webRequest);
122118
}
123119

124120
return GetResponse(webRequest);

0 commit comments

Comments
 (0)