System.Net.WebClient.UploadValuesAsync C# (CSharp) Method

UploadValuesAsync() public method

public UploadValuesAsync ( System address, System data ) : void
address System
data System
return void
        public void UploadValuesAsync(System.Uri address, System.Collections.Specialized.NameValueCollection data) { }
        public void UploadValuesAsync(System.Uri address, string method, System.Collections.Specialized.NameValueCollection data) { }

Same methods

WebClient::UploadValuesAsync ( System address, string method, System data ) : void
WebClient::UploadValuesAsync ( System address, string method, System data, object userToken ) : void

Usage Example

Esempio n. 1
0
        internal static void SendNotifications(IEnumerable<string> apiKeys, string application, string header, string message)
        {
            var data = new NameValueCollection();
            data["AuthorizationToken"] = "";
            data["Body"] = message;
            data["IsImportant"] = IsImportant;
            data["IsSilent"] = IsSilent;
            data["Source"] = application;
            data["TimeToLive"] = TimeToLive;
            data["Title"] = header;
            if (!Validate(data))
            {
                return;
            }

            foreach (var apiKey in apiKeys)
            {
                using (var client = new WebClient())
                {
                    data.Set("AuthorizationToken", apiKey);

                    client.Headers[HttpRequestHeader.ContentType] = RequestContentType;
                    client.UploadValuesAsync(new Uri(RequestUrl), data);
                }
            }
        }
All Usage Examples Of System.Net.WebClient::UploadValuesAsync