473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Webrequest Question.

Bob
Hi,
I have a Webrequest that uses a XML doc for its 'body'
I need to know the length of the doc so I can set Webrequest header
ContentLength.
Currently I am using an XMLTextWriter to a filestream, reading that stream
back in to a Byte Array and writing the ByteArray to the Webrequest
poststream.
This solves the problem of the poststream not supporting the length property
and also the fact that you have to set the content length before you start
writing the poststream.
But...
There's got to be a better way.
How do I do this 'properly' i.e. keep it all in memory.
Thanks
Bob
Mar 15 '06 #1
1 1312
Bob
Ooops,
Think I have solved it.
Use XMLWriter with a stringbuilder.
Thanks
Bob
"Bob" <bo*@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,
I have a Webrequest that uses a XML doc for its 'body'
I need to know the length of the doc so I can set Webrequest header
ContentLength.
Currently I am using an XMLTextWriter to a filestream, reading that stream
back in to a Byte Array and writing the ByteArray to the Webrequest
poststream.
This solves the problem of the poststream not supporting the length property and also the fact that you have to set the content length before you start writing the poststream.
But...
There's got to be a better way.
How do I do this 'properly' i.e. keep it all in memory.
Thanks
Bob

Mar 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: vMike | last post by:
I don't know if I can explain this here, but I will try. I am using WebRequest/WebResponse to get product information from another website then put the selections in a shopping cart of the remote...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
0
by: Tony Archer | last post by:
Here's my problem... When I use this code to hit the site in question I'm redirected to another SSL login page. If processed successfully the page creates a cookie and then redirects you to the...
6
by: Bob | last post by:
Hi, I am new to using a web resource which is not a webservice and I am spinning my wheels with the webrequest class. I am trying to interact with a URI that has been given to me. It is say...
6
by: Jack | last post by:
I have a WebRequest object that I use to log into a site and then post some XML. In doing this I set the KeepAlive = true so that it maintains the connection and does operates undo the initial...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As...
3
by: archana | last post by:
Hi all, My main question is when i send webrequest to server, do ip address related information is also getting send onto server over network? I want to send request using webrequest class....
0
by: archana | last post by:
Hi all, I want to send webrequest using webproxy so that i can hide my Pc's ip address from server. So i decided to use proxy and set that proxy details to webrquest using webproxy. My...
4
by: CindyH | last post by:
Hi - hope someone can help with this - this code was working for a while in the 'real' code and then suddenly stopped - not sure what happen. I made two simple forms on localhost to try to test...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.