Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sending an xml file in HttpWebRequest

Reply
Thread Tools

Sending an xml file in HttpWebRequest

 
 
Roshawn Dawson
Guest
Posts: n/a
 
      09-17-2005
Hi,

I'm attempting something new, so please here me out.

I need to send an xml file in my HttpWebRequest object. IOW, I need to post some xml data to a
specified URI. (FYI, this xml is composed using the StringBuilder object.) After reading the docs,
it seems that the only place to do so is the ContentLength property.

The ContentLength property's data type is long. How do I convert the xml into long? Is there some
technique to use that does this automatically? Or is there an easier way to accomplish this task?

Thanks,
Roshawn
 
Reply With Quote
 
 
 
 
Joerg Jooss
Guest
Posts: n/a
 
      09-18-2005
Roshawn Dawson wrote:

> Hi,
>
> I'm attempting something new, so please here me out.
>
> I need to send an xml file in my HttpWebRequest object. IOW, I need
> to post some xml data to a specified URI. (FYI, this xml is composed
> using the StringBuilder object.) After reading the docs, it seems
> that the only place to do so is the ContentLength property.


Why on earth...? ContentLength defines the size of the request body in
octets. If you want to post data, write it to the request stream.

> The ContentLength property's data type is long. How do I convert the
> xml into long? Is there some technique to use that does this
> automatically? Or is there an easier way to accomplish this task?


Check out http://tinyurl.com/ble8x

Cheers,
--
http://www.joergjooss.de
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Roshawn Dawson
Guest
Posts: n/a
 
      09-21-2005
Thanks Joerg for the reply! This is just what I'm looking for.

Joerg Jooss wrote:
> Roshawn Dawson wrote:
>
>
>>Hi,
>>
>>I'm attempting something new, so please here me out.
>>
>>I need to send an xml file in my HttpWebRequest object. IOW, I need
>>to post some xml data to a specified URI. (FYI, this xml is composed
>>using the StringBuilder object.) After reading the docs, it seems
>>that the only place to do so is the ContentLength property.

>
>
> Why on earth...? ContentLength defines the size of the request body in
> octets. If you want to post data, write it to the request stream.
>
>
>>The ContentLength property's data type is long. How do I convert the
>>xml into long? Is there some technique to use that does this
>>automatically? Or is there an easier way to accomplish this task?

>
>
> Check out http://tinyurl.com/ble8x
>
> Cheers,

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload xml file- HttpWebRequest Rob ASP .Net 1 05-12-2008 03:45 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Sending XML via HttpWebRequest BuddyWork ASP .Net 5 09-30-2004 03:47 PM
httpWebRequest not sending client Certificate =?Utf-8?B?TWFydmlu?= ASP .Net 1 08-08-2004 07:28 AM



Advertisments