public void UpdateFile(string fileID, string accessToken, int uniqueID) { Action<string> OnResponse = this.OnFileUpdate; string uri = string.Format("http://api.4shared.com/v0/files/fileID.json?oauth_token={1}&UniqueID={2}",accessToken,uniquesID); uri=uri + "&name=mayank&description=This is for testing."; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(uri)); request.Method = "PUT"; request.ContentType = "application/x-www-form-urlencoded"; request.BeginGetResponse(delegate(IAsyncResult result) { HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result); using (var stream = response.GetResponseStream()) { using (StreamReader reader = new StreamReader(stream)) { string response1 = reader.ReadToEnd(); onResponseGot(response1); } } }, null); } private void OnFileUpdate(string result) { if (!string.IsNullOrEmpty(result)) { //do some code after file updates. } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)