Exemple #1
0
 /// <summary>
 /// Makes a POST request to the Facebook API. If the <code>AccessToken</code> property has
 /// been specified, the access token will be appended to the query string.
 /// </summary>
 /// <param name="url">The URL to call.</param>
 /// <param name="options">The options of the request.</param>
 public SocialHttpResponse DoAuthenticatedPostRequest(string url, IPostOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     return(DoAuthenticatedPostRequest(url, options.GetQueryString(), options.GetPostData(), options.IsMultipart));
 }
Exemple #2
0
        /// <summary>
        /// Makes a signed POST request to the specified <code>url</code>.
        /// </summary>
        /// <param name="url">The URL to call.</param>
        /// <param name="options">The options for the call to the API.</param>
        /// <returns>Returns an instance of <see cref="SocialHttpResponse"/> representing the raw response.</returns>
        public virtual SocialHttpResponse DoHttpPostRequest(string url, IPostOptions options)
        {
            SocialQueryString query    = (options == null ? null : options.GetQueryString());
            SocialPostData    postData = (options == null ? null : options.GetPostData());

            NameValueCollection nvcQuery    = (query == null ? null : query.NameValueCollection);
            NameValueCollection nvcPostData = (postData == null ? null : postData.ToNameValueCollection());

            // TODO: Converting the POST data to a NameValueCollection will not support multipart data

            return(DoHttpRequest("POST", url, nvcQuery, nvcPostData));
        }
Exemple #3
0
 /// <summary>
 /// Makes a POST request to the specified <code>url</code>.
 /// </summary>
 /// <param name="url">The URL of the request.</param>
 /// <param name="options">The options for the call to the specified <code>url</code>.</param>
 /// <returns>Returns an instance of <see cref="SocialHttpResponse"/> representing the response.</returns>
 public virtual SocialHttpResponse DoHttpPostRequest(string url, IPostOptions options)
 {
     if (String.IsNullOrWhiteSpace(url))
     {
         throw new ArgumentNullException("url");
     }
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     return(DoHttpPostRequest(url, options.GetQueryString(), options.GetPostData(), options.IsMultipart));
 }
 /// <summary>
 /// Makes a POST request to the Facebook API. If the <code>AccessToken</code> property has
 /// been specified, the access token will be appended to the query string.
 /// </summary>
 /// <param name="url">The URL to call.</param>
 /// <param name="options">The options of the request.</param>
 /// <returns>Returns an instance of <code>SocialHttpResponse</code> wrapping the response from the Facebook Graph API.</returns>
 public SocialHttpResponse DoAuthenticatedPostRequest(string url, IPostOptions options) {
     if (options == null) throw new ArgumentNullException("options");
     return DoAuthenticatedPostRequest(url, options.GetQueryString(), options.GetPostData(), options.IsMultipart);
 }
        /// <summary>
        /// Makes a signed POST request to the specified <code>url</code>.
        /// </summary>
        /// <param name="url">The URL to call.</param>
        /// <param name="options">The options for the call to the API.</param>
        public virtual SocialHttpResponse DoHttpPostRequest(string url, IPostOptions options) {

            SocialQueryString query = (options == null ? null : options.GetQueryString());
            SocialPostData postData = (options == null ? null : options.GetPostData());

            NameValueCollection nvcQuery = (query == null ? null : query.NameValueCollection);
            NameValueCollection nvcPostData = (postData == null ? null : postData.ToNameValueCollection());

            // TODO: Converting the POST data to a NameValueCollection will not support multipart data

            return SocialHttpResponse.GetFromWebResponse(DoHttpRequest("POST", url, nvcQuery, nvcPostData));

        }