byte[] data; // data goes here.
javascript:void(0)
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = userNetworkCredentials;
request.Method = "PUT";
request.ContentType = "application/octet-stream";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data,0,data.Length);
stream.Close();
response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
temp = reader.ReadToEnd();
reader.Close();
Friday, September 24, 2010
Upload files with HTTPWebrequest (multipart/form-data)
ป้ายกำกับ:
HttpWebRequest
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment