示例#1
0
        /// <summary>
        /// Make a multipart-encoded request.
        /// </summary>
        /// <param name="method">The HTTP method to use.</param>
        /// <param name="url">The URL to request to.</param>
        /// <param name="parameters">The parameters to send.</param>
        /// <returns>The server's response.</returns>
        public Webbe.Response RequestMultipart(string method, string url, Webbe.Parameter[] parameters)
        {
            string oAuthHeader = oAuth.GenerateHeader(method, url, new Dictionary <string, string>());

            Webbe w = new Webbe();

            w.Headers["Authorization"] = oAuthHeader;

            return(w.UploadMultipart(method, url, parameters));
        }
示例#2
0
        /// <summary>
        /// Make a form-encoded request.
        /// </summary>
        /// <param name="method">The HTTP method to use.</param>
        /// <param name="url">The URL to request to.</param>
        /// <param name="parameters">The parameters to send.</param>
        /// <returns>The server's response.</returns>
        public Webbe.Response RequestForm(string method, string url, Webbe.Parameter[] parameters)
        {
            string oAuthHeader = oAuth.GenerateHeader(method, url, Webbe.Parameter.ToDictionary(parameters));

            Webbe w = new Webbe();

            w.Headers["Authorization"] = oAuthHeader;

            return(w.UploadForm(method, url, parameters));
        }