diff --git a/examples/Spring/Spring.HttpMessageConverterQuickStart/src/Spring.HttpMessageConverterQuickStart/Program.cs b/examples/Spring/Spring.HttpMessageConverterQuickStart/src/Spring.HttpMessageConverterQuickStart/Program.cs index 6c16a017..374fc020 100644 --- a/examples/Spring/Spring.HttpMessageConverterQuickStart/src/Spring.HttpMessageConverterQuickStart/Program.cs +++ b/examples/Spring/Spring.HttpMessageConverterQuickStart/src/Spring.HttpMessageConverterQuickStart/Program.cs @@ -19,8 +19,8 @@ namespace Spring.HttpMessageConverterQuickStart { RestTemplate rt = new RestTemplate("http://twitter.com"); rt.MessageConverters.Add(new NJsonHttpMessageConverter()); - - rt.GetForObjectAsync("/statuses/user_timeline.json?screen_name={name}&count={count}", new string[] { "SpringForNet", "10" }, +#if SILVERLIGHT + rt.GetForObjectAsync("/statuses/user_timeline.json?screen_name={name}&count={count}", r => { if (r.Error == null) @@ -37,7 +37,17 @@ namespace Spring.HttpMessageConverterQuickStart { Console.WriteLine(r.Error); } - }); + }, "SpringForNet", 10); +#else + JArray jArray = rt.GetForObject("/statuses/user_timeline.json?screen_name={name}&count={count}", "SpringForNet", 10); + var tweets = from el in jArray.Children() + select el.Value("text"); + foreach (string tweet in tweets) + { + Console.WriteLine(String.Format("* {0}", tweet)); + Console.WriteLine(); + } +#endif } catch (Exception ex) { diff --git a/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart.2005/Program.cs b/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart.2005/Program.cs index c10e1767..4bfed57d 100644 --- a/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart.2005/Program.cs +++ b/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart.2005/Program.cs @@ -22,7 +22,7 @@ namespace Spring.RestQuickStart } // Exemple async call - rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}&count={count}", new string[] { "SpringForNet", "5" }, + rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}&count={count}", delegate(MethodCompletedEventArgs eventArgs) { if (eventArgs.Error != null) @@ -33,7 +33,7 @@ namespace Spring.RestQuickStart { Console.WriteLine(eventArgs.Response); } - }); + }, "SpringForNet", 5); } catch (Exception ex) { diff --git a/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart/Program.cs b/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart/Program.cs index da114bd2..d9d3c281 100644 --- a/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart/Program.cs +++ b/examples/Spring/Spring.RestQuickStart/src/Spring.RestQuickStart/Program.cs @@ -25,7 +25,7 @@ namespace Spring.RestQuickStart } // Exemple async call - rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}", new string[] { "SpringForNet" }, + rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}", r => { if (r.Error != null) @@ -43,7 +43,7 @@ namespace Spring.RestQuickStart } } - }); + }, "SpringForNet"); } catch (Exception ex) { diff --git a/examples/Spring/Spring.RestSilverlightQuickStart/src/Spring.RestSilverlightQuickStart/MainPage.xaml.cs b/examples/Spring/Spring.RestSilverlightQuickStart/src/Spring.RestSilverlightQuickStart/MainPage.xaml.cs index 832b625a..60eeb4ee 100644 --- a/examples/Spring/Spring.RestSilverlightQuickStart/src/Spring.RestSilverlightQuickStart/MainPage.xaml.cs +++ b/examples/Spring/Spring.RestSilverlightQuickStart/src/Spring.RestSilverlightQuickStart/MainPage.xaml.cs @@ -19,7 +19,7 @@ namespace Spring.RestSilverlightQuickStart { RestTemplate rt = new RestTemplate("http://localhost:12345/Services/Service.svc/"); - rt.PostForMessageAsync("user", "Lisa Baia", new string[] { }, + rt.PostForMessageAsync("user", "Lisa Baia", r => { if (r.Error != null) diff --git a/examples/Spring/Spring.RestWindowsPhoneQuickStart/src/MainPage.xaml.cs b/examples/Spring/Spring.RestWindowsPhoneQuickStart/src/MainPage.xaml.cs index 8b918e2a..df6e9bf4 100644 --- a/examples/Spring/Spring.RestWindowsPhoneQuickStart/src/MainPage.xaml.cs +++ b/examples/Spring/Spring.RestWindowsPhoneQuickStart/src/MainPage.xaml.cs @@ -21,16 +21,16 @@ namespace Spring.RestWindowsPhoneQuickStart { RestTemplate rt = new RestTemplate("http://twitter.com"); - rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}", new string[] { this.TwitterAccountTextBox.Text }, + rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}", args => { if (args.Error == null) { this.StatusesListBox.ItemsSource = args.Response; } - }); + }, this.TwitterAccountTextBox.Text); - //rt.GetForObjectAsync("/1/statuses/user_timeline.xml?screen_name={name}", new string[] { this.TwitterAccountTextBox.Text }, + //rt.GetForObjectAsync("/statuses/user_timeline.xml?screen_name={name}", // args => // { // if (args.Error == null) @@ -43,7 +43,7 @@ namespace Spring.RestWindowsPhoneQuickStart // UserName = tweet.Element("user").Element("screen_name").Value // }; // } - // }); + // }, this.TwitterAccountTextBox.Text); } } diff --git a/src/Spring/Spring.Http/Http/Client/WebClientHttpRequestFactory.cs b/src/Spring/Spring.Http/Http/Client/WebClientHttpRequestFactory.cs index 37895e94..a1d93579 100644 --- a/src/Spring/Spring.Http/Http/Client/WebClientHttpRequestFactory.cs +++ b/src/Spring/Spring.Http/Http/Client/WebClientHttpRequestFactory.cs @@ -32,6 +32,12 @@ namespace Spring.Http.Client /// Bruno Baia public class WebClientHttpRequestFactory : IClientHttpRequestFactory { + /// + /// The .NET used by this factory + /// or if not created. + /// + private HttpWebRequest httpWebRequest; + #region Properties #if !SILVERLIGHT_3 @@ -116,27 +122,17 @@ namespace Spring.Http.Client } #endif - private HttpWebRequest httpWebRequest; - /// - /// Gets the .NET used by this factory - /// or if not created. - /// - public HttpWebRequest HttpWebRequest - { - get { return this.httpWebRequest; } - } - #endregion +#if SILVERLIGHT && !WINDOWS_PHONE /// /// Creates a new instance of . /// public WebClientHttpRequestFactory() { -#if SILVERLIGHT && !WINDOWS_PHONE this._webRequestCreator = WebRequestCreatorType.Unknown; -#endif } +#endif #region IClientHttpRequestFactory Membres diff --git a/src/Spring/Spring.Http/Http/Rest/IRestAsyncOperations.cs b/src/Spring/Spring.Http/Http/Rest/IRestAsyncOperations.cs index d23e4223..52f86688 100644 --- a/src/Spring/Spring.Http/Http/Rest/IRestAsyncOperations.cs +++ b/src/Spring/Spring.Http/Http/Rest/IRestAsyncOperations.cs @@ -48,11 +48,11 @@ namespace Spring.Http.Rest /// /// The type of the response value. /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous GET method completes. /// - void GetForObjectAsync(string url, object[] uriVariables, Action> getCompleted) where T : class; + /// The variables to expand the template. + void GetForObjectAsync(string url, Action> getCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously retrieve a representation by doing a GET on the specified URL. @@ -89,11 +89,11 @@ namespace Spring.Http.Rest /// /// The type of the response value. /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous GET method completes. /// - void GetForMessageAsync(string url, object[] uriVariables, Action>> getCompleted) where T : class; + /// The variables to expand the template. + void GetForMessageAsync(string url, Action>> getCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously retrieve an entity by doing a GET on the specified URL. @@ -132,11 +132,11 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous HEAD method completes. /// - void HeadForHeadersAsync(string url, object[] uriVariables, Action> headCompleted); + /// The variables to expand the template. + void HeadForHeadersAsync(string url, Action> headCompleted, params object[] uriVariables); /// /// Asynchronously retrieve all headers of the resource specified by the URI template. @@ -178,11 +178,11 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - void PostForLocationAsync(string url, object request, object[] uriVariables, Action postCompleted); + /// The variables to expand the template. + void PostForLocationAsync(string url, object request, Action postCompleted, params object[] uriVariables); /// /// Asynchronously create a new resource by POSTing the given object to the URI template, @@ -232,11 +232,11 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - void PostForObjectAsync(string url, object request, object[] uriVariables, Action> postCompleted) where T : class; + /// The variables to expand the template. + void PostForObjectAsync(string url, object request, Action> postCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously create a new resource by POSTing the given object to the URI template, @@ -286,11 +286,11 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - void PostForMessageAsync(string url, object request, object[] uriVariables, Action>> postCompleted) where T : class; + /// The variables to expand the template. + void PostForMessageAsync(string url, object request, Action>> postCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously create a new resource by POSTing the given object to the URI template, @@ -339,11 +339,11 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - void PostForMessageAsync(string url, object request, object[] uriVariables, Action> postCompleted); + /// The variables to expand the template. + void PostForMessageAsync(string url, object request, Action> postCompleted, params object[] uriVariables); /// /// Asynchronously create a new resource by POSTing the given object to the URI template, @@ -393,11 +393,11 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous PUT method completes. /// - void PutAsync(string url, object request, object[] uriVariables, Action> putCompleted); + /// The variables to expand the template. + void PutAsync(string url, object request, Action> putCompleted, params object[] uriVariables); /// /// Asynchronously create or update a resource by PUTting the given object to the URI. @@ -440,11 +440,11 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous PUT method completes. /// - void DeleteAsync(string url, object[] uriVariables, Action> deleteCompleted); + /// The variables to expand the template. + void DeleteAsync(string url, Action> deleteCompleted, params object[] uriVariables); /// /// Asynchronously delete the resources at the specified URI. @@ -479,11 +479,11 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous OPTIONS method completes. /// - void OptionsForAllowAsync(string url, object[] uriVariables, Action> optionsCompleted); + /// The variables to expand the template. + void OptionsForAllowAsync(string url, Action> optionsCompleted, params object[] uriVariables); /// /// Asynchronously return the value of the Allow header for the given URI. @@ -525,11 +525,11 @@ namespace Spring.Http.Rest /// /// The HTTP entity (headers and/or body) to write to the request, may be . /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, object[] uriVariables, Action>> methodCompleted) where T : class; + /// The variables to expand the template. + void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, Action>> methodCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously execute the HTTP method to the given URI template, writing the given request message to the request, @@ -577,11 +577,11 @@ namespace Spring.Http.Rest /// /// The HTTP entity (headers and/or body) to write to the request, may be . /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, object[] uriVariables, Action> methodCompleted); + /// The variables to expand the template. + void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, Action> methodCompleted, params object[] uriVariables); /// /// Asynchronously execute the HTTP method to the given URI template, writing the given request message to the request, @@ -631,11 +631,11 @@ namespace Spring.Http.Rest /// The HTTP method (GET, POST, etc.) /// Object that prepares the request. /// Object that extracts the return value from the response. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - void ExecuteAsync(string url, HttpMethod method, IRequestCallback requestCallback, IResponseExtractor responseExtractor, object[] uriVariables, Action> methodCompleted) where T : class; + /// The variables to expand the template. + void ExecuteAsync(string url, HttpMethod method, IRequestCallback requestCallback, IResponseExtractor responseExtractor, Action> methodCompleted, params object[] uriVariables) where T : class; /// /// Asynchronously execute the HTTP method to the given URI template, preparing the request with the diff --git a/src/Spring/Spring.Http/Http/Rest/RestTemplate.cs b/src/Spring/Spring.Http/Http/Rest/RestTemplate.cs index 417f06b3..d80c8304 100644 --- a/src/Spring/Spring.Http/Http/Rest/RestTemplate.cs +++ b/src/Spring/Spring.Http/Http/Rest/RestTemplate.cs @@ -998,15 +998,15 @@ namespace Spring.Http.Rest /// /// The type of the response value. /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous GET method completes. /// - public void GetForObjectAsync(string url, object[] uriVariables, Action> getCompleted) where T : class + /// The variables to expand the template. + public void GetForObjectAsync(string url, Action> getCompleted, params object[] uriVariables) where T : class { AcceptHeaderRequestCallback requestCallback = new AcceptHeaderRequestCallback(typeof(T), this._messageConverters); MessageConverterResponseExtractor responseExtractor = new MessageConverterResponseExtractor(this._messageConverters); - this.ExecuteAsync(url, HttpMethod.GET, requestCallback, responseExtractor, uriVariables, getCompleted); + this.ExecuteAsync(url, HttpMethod.GET, requestCallback, responseExtractor, getCompleted, uriVariables); } /// @@ -1054,15 +1054,15 @@ namespace Spring.Http.Rest /// /// The type of the response value. /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous GET method completes. /// - public void GetForMessageAsync(string url, object[] uriVariables, Action>> getCompleted) where T : class + /// The variables to expand the template. + public void GetForMessageAsync(string url, Action>> getCompleted, params object[] uriVariables) where T : class { AcceptHeaderRequestCallback requestCallback = new AcceptHeaderRequestCallback(typeof(T), this._messageConverters); HttpMessageResponseExtractor responseExtractor = new HttpMessageResponseExtractor(this._messageConverters); - this.ExecuteAsync>(url, HttpMethod.GET, requestCallback, responseExtractor, uriVariables, getCompleted); + this.ExecuteAsync>(url, HttpMethod.GET, requestCallback, responseExtractor, getCompleted, uriVariables); } /// @@ -1112,13 +1112,13 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous HEAD method completes. /// - public void HeadForHeadersAsync(string url, object[] uriVariables, Action> headCompleted) + /// The variables to expand the template. + public void HeadForHeadersAsync(string url, Action> headCompleted, params object[] uriVariables) { - this.ExecuteAsync(url, HttpMethod.HEAD, null, this.headersExtractor, uriVariables, headCompleted); + this.ExecuteAsync(url, HttpMethod.HEAD, null, this.headersExtractor, headCompleted, uriVariables); } /// @@ -1167,18 +1167,19 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - public void PostForLocationAsync(string url, object request, object[] uriVariables, Action postCompleted) + /// The variables to expand the template. + public void PostForLocationAsync(string url, object request, Action postCompleted, params object[] uriVariables) { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(request, this._messageConverters); - this.ExecuteAsync(url, HttpMethod.POST, requestCallback, this.headersExtractor, uriVariables, + this.ExecuteAsync(url, HttpMethod.POST, requestCallback, this.headersExtractor, delegate (MethodCompletedEventArgs args) { postCompleted(args.Response.Location); - }); + }, + uriVariables); } /// @@ -1245,15 +1246,15 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - public void PostForObjectAsync(string url, object request, object[] uriVariables, Action> postCompleted) where T : class + /// The variables to expand the template. + public void PostForObjectAsync(string url, object request, Action> postCompleted, params object[] uriVariables) where T : class { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(request, typeof(T), this._messageConverters); MessageConverterResponseExtractor responseExtractor = new MessageConverterResponseExtractor(this._messageConverters); - this.ExecuteAsync(url, HttpMethod.POST, requestCallback, responseExtractor, uriVariables, postCompleted); + this.ExecuteAsync(url, HttpMethod.POST, requestCallback, responseExtractor, postCompleted, uriVariables); } /// @@ -1314,15 +1315,15 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - public void PostForMessageAsync(string url, object request, object[] uriVariables, Action>> postCompleted) where T : class + /// The variables to expand the template. + public void PostForMessageAsync(string url, object request, Action>> postCompleted, params object[] uriVariables) where T : class { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(request, typeof(T), this._messageConverters); HttpMessageResponseExtractor responseExtractor = new HttpMessageResponseExtractor(this._messageConverters); - this.ExecuteAsync>(url, HttpMethod.POST, requestCallback, responseExtractor, uriVariables, postCompleted); + this.ExecuteAsync>(url, HttpMethod.POST, requestCallback, responseExtractor, postCompleted, uriVariables); } /// @@ -1382,15 +1383,15 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous POST method completes. /// - public void PostForMessageAsync(string url, object request, object[] uriVariables, Action> postCompleted) + /// The variables to expand the template. + public void PostForMessageAsync(string url, object request, Action> postCompleted, params object[] uriVariables) { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(request, this._messageConverters); HttpMessageResponseExtractor responseExtractor = new HttpMessageResponseExtractor(); - this.ExecuteAsync(url, HttpMethod.POST, requestCallback, responseExtractor, uriVariables, postCompleted); + this.ExecuteAsync(url, HttpMethod.POST, requestCallback, responseExtractor, postCompleted, uriVariables); } /// @@ -1451,14 +1452,14 @@ namespace Spring.Http.Rest /// /// The object to be POSTed, may be a in order to add additional HTTP headers. /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous PUT method completes. /// - public void PutAsync(string url, object request, object[] uriVariables, Action> putCompleted) + /// The variables to expand the template. + public void PutAsync(string url, object request, Action> putCompleted, params object[] uriVariables) { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(request, this._messageConverters); - this.ExecuteAsync(url, HttpMethod.PUT, requestCallback, null, uriVariables, putCompleted); + this.ExecuteAsync(url, HttpMethod.PUT, requestCallback, null, putCompleted, uriVariables); } /// @@ -1510,13 +1511,13 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous PUT method completes. /// - public void DeleteAsync(string url, object[] uriVariables, Action> deleteCompleted) + /// The variables to expand the template. + public void DeleteAsync(string url, Action> deleteCompleted, params object[] uriVariables) { - this.ExecuteAsync(url, HttpMethod.DELETE, null, null, uriVariables, deleteCompleted); + this.ExecuteAsync(url, HttpMethod.DELETE, null, null, deleteCompleted, uriVariables); } /// @@ -1558,17 +1559,18 @@ namespace Spring.Http.Rest /// URI Template variables are expanded using the given URI variables, if any. /// /// The URL. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous OPTIONS method completes. /// - public void OptionsForAllowAsync(string url, object[] uriVariables, Action> optionsCompleted) + /// The variables to expand the template. + public void OptionsForAllowAsync(string url, Action> optionsCompleted, params object[] uriVariables) { - this.ExecuteAsync(url, HttpMethod.OPTIONS, null, this.headersExtractor, uriVariables, + this.ExecuteAsync(url, HttpMethod.OPTIONS, null, this.headersExtractor, delegate(MethodCompletedEventArgs args) { optionsCompleted(args.Response.Allow); - }); + }, + uriVariables); } /// @@ -1625,15 +1627,15 @@ namespace Spring.Http.Rest /// /// The HTTP entity (headers and/or body) to write to the request, may be . /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - public void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, object[] uriVariables, Action>> methodCompleted) where T : class + /// The variables to expand the template. + public void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, Action>> methodCompleted, params object[] uriVariables) where T : class { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, typeof(T), this._messageConverters); HttpMessageResponseExtractor responseExtractor = new HttpMessageResponseExtractor(this._messageConverters); - this.ExecuteAsync>(url, method, requestCallback, responseExtractor, uriVariables, methodCompleted); + this.ExecuteAsync>(url, method, requestCallback, responseExtractor, methodCompleted, uriVariables); } /// @@ -1692,15 +1694,15 @@ namespace Spring.Http.Rest /// /// The HTTP entity (headers and/or body) to write to the request, may be . /// - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - public void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, object[] uriVariables, Action> methodCompleted) + /// The variables to expand the template. + public void ExchangeAsync(string url, HttpMethod method, HttpEntity requestEntity, Action> methodCompleted, params object[] uriVariables) { HttpEntityRequestCallback requestCallback = new HttpEntityRequestCallback(requestEntity, this._messageConverters); HttpMessageResponseExtractor responseExtractor = new HttpMessageResponseExtractor(); - this.ExecuteAsync(url, method, requestCallback, responseExtractor, uriVariables, methodCompleted); + this.ExecuteAsync(url, method, requestCallback, responseExtractor, methodCompleted, uriVariables); } /// @@ -1761,11 +1763,11 @@ namespace Spring.Http.Rest /// The HTTP method (GET, POST, etc.) /// Object that prepares the request. /// Object that extracts the return value from the response. - /// The variables to expand the template. /// /// The Action<T> to perform when the asynchronous method completes. /// - public void ExecuteAsync(string url, HttpMethod method, IRequestCallback requestCallback, IResponseExtractor responseExtractor, object[] uriVariables, Action> methodCompleted) where T : class + /// The variables to expand the template. + public void ExecuteAsync(string url, HttpMethod method, IRequestCallback requestCallback, IResponseExtractor responseExtractor, Action> methodCompleted, params object[] uriVariables) where T : class { this.DoExecuteAsync(BuildUri(this._baseAddress, url, uriVariables), method, requestCallback, responseExtractor, methodCompleted); @@ -1986,7 +1988,7 @@ namespace Spring.Http.Rest /// The variables to expand the template. /// The absolute build URI. /// If an absolute URI can't be build. - protected virtual Uri BuildUri(Uri baseAddress, string url, object[] uriVariables) + protected virtual Uri BuildUri(Uri baseAddress, string url, params object[] uriVariables) { UriTemplate uriTemplate = new UriTemplate(url); Uri uri = uriTemplate.Expand(uriVariables);