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
jitendra chaudhary
NA
8
574
Send http request and get result
Feb 7 2017 2:44 AM
Hello Sir,
I am using below code for send request .
Send request is working fine but not return result on sending request page .
Please help me ASAP.
protected void Button1_Click(object sender, EventArgs e)
{
string remoteUrl = "http://localhost:8917/testweb/use_lodar.aspx";
string firstName = "
[email protected]
";
string lastName = "65432177";
ASCIIEncoding encoding = new ASCIIEncoding();
string data = string.Format("FirstName={0}&LastName={1}", firstName, lastName);
byte[] bytes = encoding.GetBytes(data);
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(remoteUrl);
httpRequest.Method = "POST";
httpRequest.ContentType = "application/x-www-form-urlencoded";
httpRequest.ContentLength = bytes.Length;
using (Stream stream = httpRequest.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
stream.Close();
}
HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream());
string responseData = streamReader.ReadToEnd();
streamReader.Close();
}
Thanks
jitendra chaudhary.
Reply
Answers (
1
)
how to serch data from this gridview
How to validate external logins access token in c#