Skip to content

Commit 20bfaa1

Browse files
committed
Fix compatibility for SL and WP
1 parent f770c1a commit 20bfaa1

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

RestSharp/RestClient.Sync.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ namespace RestSharp
1111
public partial class RestClient
1212
{
1313

14-
/// <summary>
15-
/// Proxy to use for requests made by this client instance.
16-
/// Passed on to underying WebRequest if set.
17-
/// </summary>
18-
public IWebProxy Proxy { get; set; }
1914

2015
/// <summary>
2116
/// Executes the specified request and downloads the response data
@@ -119,14 +114,6 @@ private static HttpResponse DoExecuteAsPost(IHttp http, string method)
119114
{
120115
return Deserialize<T>(request, ExecuteAsPost(request, httpMethod));
121116
}
122-
123-
private void ConfigureProxy(IHttp http)
124-
{
125-
if (Proxy != null)
126-
{
127-
http.Proxy = Proxy;
128-
}
129-
}
130117
}
131118
}
132119
#endif

RestSharp/RestClient.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ IDeserializer GetHandler(string contentType)
149149
/// X509CertificateCollection to be sent with request
150150
/// </summary>
151151
public X509CertificateCollection ClientCertificates { get; set; }
152+
153+
/// <summary>
154+
/// Proxy to use for requests made by this client instance.
155+
/// Passed on to underying WebRequest if set.
156+
/// </summary>
157+
public IWebProxy Proxy { get; set; }
152158
#endif
153159

154160
/// <summary>
@@ -375,10 +381,21 @@ private void ConfigureHttp(IRestRequest request, IHttp http)
375381
http.RequestBody = body.Value.ToString();
376382
http.RequestContentType = body.Name;
377383
}
378-
384+
#if FRAMEWORK
379385
ConfigureProxy(http);
386+
#endif
380387
}
381388

389+
#if FRAMEWORK
390+
private void ConfigureProxy(IHttp http)
391+
{
392+
if (Proxy != null)
393+
{
394+
http.Proxy = Proxy;
395+
}
396+
}
397+
#endif
398+
382399
private RestResponse ConvertToRestResponse(IRestRequest request, HttpResponse httpResponse)
383400
{
384401
var restResponse = new RestResponse();

0 commit comments

Comments
 (0)