Raw HTTP POST using C# .Net?  Is there such a thing as a POST w/o fields?  (Convert Perl to .Net)

Posted on 2010-03-31
Medium Priority
Last Modified: 2013-11-18
Background: In the past when I've done a HTTP POST, it's always been in a web form submit scenario.  I have experience adding name/value pairs to NameValueCollection and passing that to the .Net library class WebClient.UploadValues.  Voila.

Current problem: I'm currently required to POST some XML but apparently there are no fields. I'm guessing this is a "raw" HTTP Post? I guess I haven't encountered this before.

Question: What does this mean?  Is there such a thing as a "raw" HTML Post w/o form fields? I have some example Perl code below that does it (attached).

How do I pull off a raw HTTP POST using C# .Net?  Do I use UploadData(string address, byte[] data) ???
my $ua = new LWP::UserAgent;

$ua->agent("post.pl/1.0 " . $ua->agent);

my $request = new HTTP::Request POST => $url;

$request->push_header("FileType", "SomeThing");

my $results = $ua->request($request);

Open in new window

Question by:ZuZuPetals
  • 2
LVL 24

Accepted Solution

alexey_gusev earned 2000 total points
ID: 29307019
LVL 24

Expert Comment

ID: 29307160
in above link, ignore "parameters", set your content type and then write xml into request stream

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

600 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