/// <summary> /// Make a request to the Facebook Graph API to delete a graph object. /// </summary> /// <param name="graphPath"> /// Path to the resource in the Facebook graph. /// </param> /// <param name="parameters">key-value string parameters.</param> /// <returns> /// Returns result. /// </returns> /// <remarks> /// See http://developers.facebook.com/docs/api /// /// Note that this method is synchronous. /// This method blocks waiting for a network reponse, /// so do not call it in a UI thread. /// /// To delete objects in the graph, /// provide "/id", which will delete http://graph.facebook.com/id /// /// You can delete a like by providing /POST_ID/likes (since likes don't have an ID). /// </remarks> public string Delete(string graphPath, IDictionary <string, string> parameters) { return (GraphContext.Execute( new FacebookGraphRestSharpMessage(this) { Resource = graphPath, Parameters = parameters, AddAccessToken = true }, Method.DELETE)); }
/// <summary> /// Make a request to the Facebook Graph API with the given string parameters. /// </summary> /// <param name="graphPath">Path to the resource in the Facebook graph.</param> /// <param name="parameters">key-value string parameters.</param> /// <param name="addAccessToken">Add whether to set the access token or not.</param> /// <returns>JSON string represnetation of the response.</returns> /// <remarks> /// See http://developers.facebook.com/docs/api /// /// Note that this method is synchronous. /// This method blocks waiting for a network reponse, /// so do not call it in a UI thread. /// /// To fetch data about the currently logged authenticated user, /// provide "/me", which will fetch http://graph.facebook.com/me /// /// For parameters: /// key-value string parameters, e.g. the path "search" with /// parameters "q" : "facebook" would produce a query for the /// following graph resource: /// https://graph.facebook.com/search?q=facebook /// </remarks> public string Get(string graphPath, IDictionary <string, string> parameters, bool addAccessToken) { return (GraphContext.Execute( new FacebookGraphRestSharpMessage(this) { Resource = graphPath, Parameters = parameters, AddAccessToken = addAccessToken }, Method.GET)); }