?
Solved

How can I post data using HttpWebRequest?

Posted on 2009-04-02
4
Medium Priority
?
1,012 Views
Last Modified: 2012-05-06
I'm trying to send the following request to a server. How can I do this using C#? The server will be expecting this post, and it will then reply back with some information.

POST /bobl/bobl HTTP/1.1
Host: hostedconnect.m5net.com
Connection: keep-alive
Content-Type: text/plain
Transfer-Encoding: chunked
0
Comment
Question by:nyphalanx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
jjardine earned 1500 total points
ID: 24056086
This shows how to do it..  http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

A little broken up but shows how to add the content.
0
 

Author Comment

by:nyphalanx
ID: 24060193
Is there any way to view the header that is being sent? I want to verify that something like the header below is actually being sent.

POST /bobl/bobl HTTP/1.1
Host: hostedconnect.m5net.com
Connection: keep-alive
Content-Type: text/plain
Transfer-Encoding: chunked
0
 

Author Comment

by:nyphalanx
ID: 24060721
Nevermind, I figure out why our implementation wasn't working. Everytime we went to read the response it was always blank, we had to set HttpWebRequest.AllowReadStreamBuffering  to false.
0
 

Author Closing Comment

by:nyphalanx
ID: 31566090
You answered my question, it was part of a larger issue we were having but you answered the specific question I asked.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question