TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Besik Betchvaia
NA
8
0
Httpwebrequest - get final response after status code 102
Dec 15 2013 3:56 AM
I have encountered following problem. In my application I do simple Httpwebrequest to a server with "POST" method. As a response I got status code 102 ("Processing"). My question is, how to wait and get final response from the server.
Dictionary<string, string> dicForm = new Dictionary<string, string>();
dicForm.Add("DVdevsel", counterNum);
string boundary = "---------------------------" + genBoundary(14);
byte[] data = this.genFormData(dicForm, boundary);
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
myHttpWebRequest.Method = "POST";
myHttpWebRequest.KeepAlive = false;
myHttpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
myHttpWebRequest.ContentLength = data.Length;
Stream requestStream = myHttpWebRequest.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream responseStream = myHttpWebResponse.GetResponseStream();
StreamReader myStreamReader = new StreamReader(responseStream, Encoding.Default);
string pageContent = myStreamReader.ReadToEnd();
myStreamReader.Close();
responseStream.Close();
myHttpWebResponse.Close();
Reply
Answers (
0
)
Want add Google Translation API in aspx page
C# asp.net winforms strings