/// <summary> /// Prepares the request object to create a new model. /// </summary> /// <param name="commentToCreate"></param> /// <param name="uri"></param> /// <returns></returns> private IRestRequest PrepareCommentCreateRequest(CommentsNewModel commentToCreate, string uri) { var request = new RestRequest(Method.POST); request.Resource = uri; //Add body to the request request.AddParameter(CommentsNewModel.ContentType, _tokenManager.DefaultJsonSerializer.Serialize(new { comment = commentToCreate.Comment }), ParameterType.RequestBody); return(request); }
public void CreateCommentAsync(Action success, Action <HealthGraphException> failure, CommentsNewModel commentToCreate, string uri) { var request = PrepareCommentCreateRequest(commentToCreate, uri); _tokenManager.ExecuteAsync(request, success, failure); }
public void CreateComment(CommentsNewModel commentToCreate, string uri) { var request = PrepareCommentCreateRequest(commentToCreate, uri); _tokenManager.Execute(request); }