@@ -50,7 +50,7 @@ private static byte[] GetMultipartFormData(Dictionary<string, object> postParame
5050 {
5151 // TODO: stream is not disposed
5252 MemoryStream formDataStream = new MemoryStream ( ) ;
53- var needsCrlf = false ;
53+ bool needsCrlf = false ;
5454
5555 if ( postParameters . Count > 0 )
5656 {
@@ -91,7 +91,7 @@ private static byte[] GetMultipartFormData(Dictionary<string, object> postParame
9191
9292 // Dump the Stream into a byte[]
9393 formDataStream . Position = 0 ;
94- var formData = new byte [ formDataStream . Length ] ;
94+ byte [ ] formData = new byte [ formDataStream . Length ] ;
9595 int _ = formDataStream . Read ( formData , 0 , formData . Length ) ;
9696 formDataStream . Close ( ) ;
9797
@@ -143,14 +143,14 @@ private object InvokeInternal(
143143 private WebRequest PrepareRequest ( string path , string method , Dictionary < string , object > formParams ,
144144 Dictionary < string , string > headerParams , string body , string contentType )
145145 {
146- var request = WebRequest . Create ( path ) ;
146+ WebRequest request = WebRequest . Create ( path ) ;
147147 request . Method = method ;
148148
149149 byte [ ] formData = null ;
150150 if ( formParams . Count > 0 )
151151 {
152152
153- var formDataBoundary = Guid . NewGuid ( ) . ToString ( ) ;
153+ string formDataBoundary = Guid . NewGuid ( ) . ToString ( ) ;
154154 request . ContentType = "multipart/form-data; boundary=" + formDataBoundary ;
155155 formData = GetMultipartFormData ( formParams , formDataBoundary ) ;
156156
@@ -193,7 +193,7 @@ private WebRequest PrepareRequest(string path, string method, Dictionary<string,
193193
194194 if ( body != null )
195195 {
196- var requestWriter = new StreamWriter ( streamToSend ) ;
196+ StreamWriter requestWriter = new StreamWriter ( streamToSend ) ;
197197 requestWriter . Write ( body ) ;
198198 requestWriter . Flush ( ) ;
199199 }
@@ -223,8 +223,8 @@ private WebRequest PrepareRequest(string path, string method, Dictionary<string,
223223
224224 private object ReadResponse ( WebRequest client , bool binaryResponse )
225225 {
226- var webResponse = ( HttpWebResponse ) GetResponse ( client ) ;
227- var resultStream = new MemoryStream ( ) ;
226+ HttpWebResponse webResponse = ( HttpWebResponse ) GetResponse ( client ) ;
227+ MemoryStream resultStream = new MemoryStream ( ) ;
228228
229229 StreamHelper . CopyTo ( webResponse . GetResponseStream ( ) , resultStream ) ;
230230 try
@@ -237,7 +237,7 @@ private object ReadResponse(WebRequest client, bool binaryResponse)
237237 return resultStream ;
238238 }
239239
240- using ( var responseReader = new StreamReader ( resultStream ) )
240+ using ( StreamReader responseReader = new StreamReader ( resultStream ) )
241241 {
242242 string responseData = responseReader . ReadToEnd ( ) ;
243243 resultStream . Dispose ( ) ;
@@ -275,7 +275,7 @@ public async Task<Stream> InvokeBinaryApiAsync(string path,
275275 MultipartFormDataContent formParams ,
276276 string contentType = "application/json" )
277277 {
278- var responseStream = await InvokeInternalAsync ( path , method , true , body , headerParams , formParams , contentType )
278+ Stream responseStream = await InvokeInternalAsync ( path , method , true , body , headerParams , formParams , contentType )
279279 as Stream ;
280280 return responseStream ;
281281 }
@@ -287,7 +287,7 @@ public async Task<string> InvokeApiAsync(string path,
287287 MultipartFormDataContent formParams ,
288288 string contentType = "application/json" )
289289 {
290- var response = await InvokeInternalAsync ( path , method , false , body , headerParams , formParams , contentType ) as string ;
290+ string response = await InvokeInternalAsync ( path , method , false , body , headerParams , formParams , contentType ) as string ;
291291 return response ;
292292 }
293293
@@ -305,9 +305,9 @@ private async Task<object> InvokeInternalAsync(string path,
305305 }
306306 await Task . WhenAll ( _requestHandlers . Select ( p => p . PreparingAsync ( ) ) . ToArray ( ) ) ;
307307
308- using ( var client = new HttpClient ( ) )
308+ using ( HttpClient client = new HttpClient ( ) )
309309 {
310- using ( var request = new HttpRequestMessage ( new HttpMethod ( method ) , path ) )
310+ using ( HttpRequestMessage request = new HttpRequestMessage ( new HttpMethod ( method ) , path ) )
311311 {
312312 if ( ! ( formParams is null ) )
313313 {
0 commit comments