The Response class (Gravatar.NET.GravatarServiceResponse
) is used by the client to retrieve the details of a successful request or the error details of an unsuccessful one.
Due to the difference between method responses sent back from Gravatar several response properties are exposed by the response object:
||Used for methods
||As it name suggests, the response in this case is numerical
||As it name suggests, the response in the case is either true or false
||A list of GravatarUserImage objects representing the images associated with the account
||Used for methods that return an array of Boolean responses
||A list of GravatarAddress objects representing the addresses associated with the account
||The result of saving a new image to Gravatar either by direct upload or with a URL
Using the response properties mentioned above is the best way to process the result of a request made through one of the methods.
The Response object also exposes the collection of parameters that were returned from the Gravatar server, depending on the method called the collection
will contain a different number and types of
), the parameters are exposed using the ResponseParameters
In addition, the Response object also allows insight into the raw XML returned from the Gravatar server by using the
It's possible that a request will fail to execute for several reasons, it could be that there is a network issue between the client and the Gravatar server or perhaps invalid values are passed into a method call.
When that happens, the response object's IsError
property will return true and the information of the error will be passed through the
: Will hold the identifier either returned from Gravatar with the following possible values:
-7 Use secure.gravatar.com
-8 Internal error
-9 Authentication error
-10 Method parameter missing
-11 Method parameter incorrect
-100 Misc error (see text)
Or -1000 indicating that the error occurred on the client side, most likely due to a network error.
: Will hold a more descriptive information about the error that occurred.