Making a request to Gravatar is done using one of the methods of the GravatarService class.

For example to retrieve a list of addresses associated with an account the code will look like this:

var m_Email = "";
var m_Password = "my password";

var service = new GravatarService(m_Email, m_Password);

GravatarServiceResponse response = service.Addresses();

if (!response.IsError) //no error, check results
	foreach (GravatarAddress adr in response.AddressesResponse) //addresses method will return an addresses list.
		Console.WriteLine("Address: '{0}', active image URL: '{1}'", adr.Name, adr.Image.Url);
else //error occurred, show info
	Console.WriteLine("Error: {0}) {1}", response.ErrorCode, response.ErrorInfo);

Last edited Jul 11, 2010 at 3:53 PM by yoavniran, version 1


No comments yet.