Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster Tony John
Online Members
smitha sestu
baskar
Pawan Awasthi
Phagu Mahato
Prabu
Vishnuvardhan .G
Swapneel
More...
Forums
»
.NET
»
ASP.NET
»
How to http post method in asp.net C#
Posted Date:
12 Jul 2012
Posted By::
Vijay Khanjode
Member Level:
Silver
Member Rank:
1645
Points
: 5
Responses:
1
hi
how to send http post method in this code i want to send request with json string to server and server send http response in json formate how to handle this round trip
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
//do get request
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://www.sampadasoftware.com/aboutus.html?user=HatemSalem");
// request.Method = "POST";
// request.ContentLength = postsourcedata.Length;
HttpWebResponse response = (HttpWebResponse)
request.GetResponse();
Stream resStream = response.GetResponseStream();
string tempString = null;
int count = 0;
//read the data and print it
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Encoding.ASCII.GetString(buf, 0, count);
sb.Append(tempString);
}
}
while (count > 0);
Response.Write(sb.ToString());
Tweet
Responses
#679957 Author:
Anil Kumar Pandey
Member Level:
Platinum
Member Rank:
1
Date: 12/Jul/2012 Rating:
Points
: 2
Can you please let us know that what is the issue in your code.
You already making use of the POST method. Are you able to execute this code successfully?
Thanks & Regards
Anil Kumar Pandey
Microsoft MVP, DNS MVM
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
Regular expression for File upload control
Previous :
Excel File data inset into Oracle Database using .NET
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Follow us on Twitter:
https://twitter.com/dotnetspider
Active Members
Today
Pawan Awasthi
(13)
baskar
(7)
Swapneel
(6)
Last 7 Days
baskar
(298)
Asheej T K
(173)
Ultimaterengan
(167)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds