Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated quicks starts

  • Loading branch information...
commit 690f81fc1f36b4b40393f9a1678d283667e8237c 1 parent 78c67d1
@bbaia bbaia authored
View
23 ...pring.HttpMessageConverterQuickStart/src/Spring.HttpMessageConverterQuickStart/Program.cs
@@ -19,13 +19,36 @@ static void Main(string[] args)
template.MessageConverters.Add(new ImageHttpMessageConverter());
// Get image from url
+#if NET_4_0
+ Bitmap gitHubLogo = template.GetForObjectAsync<Bitmap>("https://github.com/images/modules/header/logov3.png").Result;
+#else
Bitmap gitHubLogo = template.GetForObject<Bitmap>("https://github.com/images/modules/header/logov3.png");
+#endif
// Save image to disk
string filename = Path.Combine(Environment.CurrentDirectory, "GitHubLogo.png");
gitHubLogo.Save(filename);
Console.WriteLine(String.Format("Saved GitHub logo to '{0}'", filename));
}
+#if NET_4_0
+ catch (AggregateException ae)
+ {
+ ae.Handle(ex =>
+ {
+ if (ex is HttpResponseException)
+ {
+ Console.WriteLine(((HttpResponseException)ex).GetResponseBodyAsString());
+ return true;
+ }
+ return false;
+ });
+ }
+#else
+ catch (HttpResponseException ex)
+ {
+ Console.WriteLine(ex.GetResponseBodyAsString());
+ }
+#endif
catch (Exception ex)
{
Console.WriteLine(ex);
View
2  examples/Spring.RestWindowsPhoneQuickStart/src/Twitter/Tweet.cs
@@ -2,7 +2,7 @@
namespace Spring.RestWindowsPhoneQuickStart.Twitter
{
- // See Spring.Social Twitter project: https://github.com/SpringSource/spring-net-social-twitter
+ // See Spring.Social Twitter project: https://www.springframework.net/social-twitter/
/// <summary>
/// Represents a Twitter status update (e.g., a "tweet").
View
2  examples/Spring.RestWindowsPhoneQuickStart/src/Twitter/TwitterClient.cs
@@ -7,7 +7,7 @@
namespace Spring.RestWindowsPhoneQuickStart.Twitter
{
- // See Spring.Social Twitter project: https://github.com/SpringSource/spring-net-social-twitter
+ // See Spring.Social Twitter project: https://www.springframework.net/social-twitter/
// Central class for interacting with Twitter
// Simplified implementation that only performs unauthenticated operations against Twitter's API.
Please sign in to comment.
Something went wrong with that request. Please try again.