예제 #1
0
        public static YifyPostRequest GetForgotUserPasswordRequest(string appKey, string email)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.ForgotUserPassword.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("email", email);
            return(req);
        }
예제 #2
0
        public static YifyPostRequest GetDeleteCommentReqeust(string appKey, string userKey, int commentID)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.DeleteComment.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("user_key", userKey);
            req.Data.Add("comment_id", commentID.ToString());
            return(req);
        }
예제 #3
0
        public static YifyPostRequest GetDeleteMovieBookmarkReqeust(string appKey, string userKey, int movieID)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.DeleteMovieBookmark.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("user_key", userKey);
            req.Data.Add("movie_id", movieID.ToString());
            return(req);
        }
예제 #4
0
        public static YifyPostRequest GetResetUserPasswordRequest(string appKey, string resetCode, string newPassword)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.ResetUserPassword.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("reset_code", resetCode);
            req.Data.Add("new_password", newPassword);
            return(req);
        }
예제 #5
0
        public static YifyPostRequest GetMakeRequestReqeust(string appKey, string userKey, string movieTitle, string requestMessage)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.MakeRequest.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("user_key", userKey);
            req.Data.Add("movie_title", movieTitle);
            req.Data.Add("request_message", requestMessage);
            return(req);
        }
예제 #6
0
        public static YifyPostRequest GetMakeCommentReqeust(string appKey, string userKey, int movieID, string commentText)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.MakeComment.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("user_key", userKey);
            req.Data.Add("movie_id", movieID.ToString());
            req.Data.Add("comment_text", commentText);
            return(req);
        }
예제 #7
0
        public static YifyPostRequest GetUserKeyRequest(string username, string password, string appKey, bool withRecentDownloads)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.GetUserKey.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("username", username);
            req.Data.Add("password", password);
            req.Data.Add("application_key", appKey);
            req.Data.Add("with_recently_downloaded", withRecentDownloads.ToString().ToLowerInvariant());
            return(req);
        }
예제 #8
0
        public static YifyPostRequest GetRegisterUserRequest(string appKey, string userName, string password, string email)
        {
            YifyPostRequest req = new YifyPostRequest();

            req.Uri = RequestUriHelper.RegisterUser.ToRequestUri(Base_URI, RESPONSE_TYPE);
            req.Data.Add("application_key", appKey);
            req.Data.Add("username", userName);
            req.Data.Add("password", password);
            req.Data.Add("email", email);

            return(req);
        }
예제 #9
0
 public static string SendPostRequest(YifyPostRequest req)
 {
     using (WebClient c = new WebClient())
     {
         if (PROXY != null)
         {
             c.Proxy = PROXY;
         }
         c.Encoding = Encoding.UTF8;
         byte[] res = c.UploadValues(req.Uri, req.Data);
         if (res.Length == 0)
         {
             return(string.Empty);
         }
         else
         {
             return(Encoding.UTF8.GetString(res));
         }
     }
 }