@@ -75,13 +75,14 @@ public Task<ConnectionStatus> Post(string path, string data)
7575 {
7676 var r = this . CreateConnection ( path , "POST" ) ;
7777 return this . DoAsyncRequest ( r , data ) ;
78-
7978 }
79+
8080 public Task < ConnectionStatus > Put ( string path , string data )
8181 {
8282 var r = this . CreateConnection ( path , "PUT" ) ;
8383 return this . DoAsyncRequest ( r , data ) ;
8484 }
85+
8586 public Task < ConnectionStatus > Delete ( string path , string data )
8687 {
8788 var r = this . CreateConnection ( path , "DELETE" ) ;
@@ -146,14 +147,14 @@ private void SetBasicAuthorizationIfNeeded(HttpWebRequest myReq)
146147 if ( myUri != null && ! string . IsNullOrEmpty ( myUri . UserInfo ) )
147148 {
148149 myReq . Headers [ "Authorization" ] =
149- "Basic " + Convert . ToBase64String ( Encoding . UTF8 . GetBytes ( myUri . UserInfo ) ) ;
150+ "Basic " + Convert . ToBase64String ( Encoding . UTF8 . GetBytes ( myUri . UserInfo ) ) ;
150151 }
151152 }
152153
153154 protected virtual HttpWebRequest CreateWebRequest ( string path , string method )
154155 {
155156 var url = this . _CreateUriString ( path ) ;
156-
157+
157158 HttpWebRequest myReq = ( HttpWebRequest ) WebRequest . Create ( url ) ;
158159 myReq . Accept = "application/json" ;
159160 myReq . ContentType = "application/json" ;
@@ -205,19 +206,19 @@ protected virtual ConnectionStatus DoSynchronousRequest(HttpWebRequest request,
205206 } ;
206207 tracer . SetResult ( cs ) ;
207208
208- _ConnectionSettings . ConnectionStatusHandler ( cs ) ;
209+ _ConnectionSettings . ConnectionStatusHandler ( cs ) ;
209210
210211 return cs ;
211212 }
212213 }
213-
214+
214215 }
215216
216217 protected virtual Task < ConnectionStatus > DoAsyncRequest ( HttpWebRequest request , string data = null )
217218 {
218219 var tcs = new TaskCompletionSource < ConnectionStatus > ( ) ;
219220 if ( this . _ConnectionSettings . MaximumAsyncConnections <= 0
220- || this . _ResourceLock == null )
221+ || this . _ResourceLock == null )
221222 return this . CreateIterateTask ( request , data , tcs ) ;
222223
223224 var timeout = this . _ConnectionSettings . Timeout ;
@@ -226,7 +227,7 @@ protected virtual Task<ConnectionStatus> DoAsyncRequest(HttpWebRequest request,
226227 using ( var tracer = new ConnectionStatusTracer ( this . _ConnectionSettings . TraceEnabled ) )
227228 {
228229 var m = "Could not start the operation before the timeout of " + timeout +
229- "ms completed while waiting for the semaphore" ;
230+ "ms completed while waiting for the semaphore" ;
230231 var cs = new ConnectionStatus ( this . _ConnectionSettings , new TimeoutException ( m ) ) ;
231232 tcs . SetResult ( cs ) ;
232233 tracer . SetResult ( cs ) ;
@@ -338,9 +339,9 @@ public void Iterate(IEnumerable<Task> asyncIterator, TaskCompletionSource<Connec
338339
339340 private Uri _CreateUriString ( string path )
340341 {
341- var s = this . _ConnectionSettings ;
342-
343-
342+ var s = this . _ConnectionSettings ;
343+
344+
344345 if ( s . QueryStringParameters != null )
345346 {
346347 var tempUri = new Uri ( s . Uri , path ) ;
@@ -349,7 +350,7 @@ private Uri _CreateUriString(string path)
349350 }
350351 path = this . _ConnectionSettings . DontDoubleEscapePathDotsAndSlashes ? path : path . Replace ( "%2F" , "%252F" ) ;
351352 var uri = new Uri ( s . Uri , path ) ;
352-
353+
353354 //WebRequest.Create will replace %2F with /
354355 //this is a 'security feature'
355356 //see http://mikehadlow.blogspot.nl/2011/08/how-to-stop-systemuri-un-escaping.html
0 commit comments