/// <summary> /// A helper method to build a Post request. Note the returned request may need to have AddUrlSegment called on it if a url segment is passed in as part of the resource param (/xyz/{id}/). /// </summary> /// <param name="resource">A string which is the location of the resource to post to.</param> /// <returns>A RestRequest instance.</returns> private RestRequest BuildPostRequest(string resource) { var req = new RestRequest(this._version + resource, Method.POST); req.AddParameter("token", this._token.AuthToken); req.AddParameter("key", TrelloApiConfig.DevKey()); return(req); }
/// <summary> /// A helper method to build a Get request. Note the returned request may need to have AddUrlSegment called on it if a url segment is passed in as part of the resource param (/xyz/{id}/). /// </summary> /// <param name="resource">A string which is the location of the resource to post to.</param> /// <param name="fields">A string of comma separeted fields to return, it is ignored if null or an empty string.</param> /// <param name="filter">A string filter to use during the api call, it is ignored if null or an empty string.</param> /// <returns>A RestRequest instance.</returns> private RestRequest BuildGetRequest(string resource, string fields = null, string filter = null) { var req = new RestRequest(this._version + resource, Method.GET); req.AddParameter("token", this._token.AuthToken); req.AddParameter("key", TrelloApiConfig.DevKey()); if (!String.IsNullOrWhiteSpace(fields)) { req.AddParameter("fields", fields); } if (!String.IsNullOrWhiteSpace(filter)) { req.AddParameter("filter", filter); } return(req); }