Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Send POST and then Recive XML - system.net.WebRequest

Posted on 2004-10-26
5
Medium Priority
?
228 Views
Last Modified: 2008-02-26
I need to be able to do this

POST /servlet/MainVCAServlet HTTP/1.0
Content-Type: text/xml
User-Agent: xLinkClient
Content-length: 544

<?xml version="1.0" standalone="no"?>
<!DOCTYPE request SYSTEM "http://xapi.covad.com/dtd/request.dtd">
<request>
<header>
<sender>
<key>
<login>YOUR LOGIN ID</login>
<password>YOUR PASSWORD</password>
</key>
</sender>
</header>
<body>
<subrequest type="serviceavailability">
<serviceavailabilityrequest>
<address>
<street1>1016 Asbury Way</street1>
<city>Mountain View</city>
<state>CA</state>
<zip>94043</zip>
</address>
</serviceavailabilityrequest>
</subrequest>
</body>
</request>

I am thinking it can be done with system.net.WebRequest
0
Comment
Question by:Vartana
[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
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12417491
Yes, you should be able to do this.  Have you started with any code?  Do you know how to form a web request?

Bob
0
 
LVL 1

Author Comment

by:Vartana
ID: 12424137
no I dont know how to use it ?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 12428454
0
 
LVL 1

Author Comment

by:Vartana
ID: 12428504
Dim myRequest As WebRequest = WebRequest.Create("http://staging.mileg.org/testapp/form2.asp")
Dim strPost As String = "textbox=simon"
MessageBox.Show(myRequest.RequestUri.ToString)myRequest.Method = "post"
myRequest.ContentLength = strPost.Length
myRequest.ContentType = "application/x-www-form-urlencoded"
Dim mystreamwriter As New StreamWriter(myRequest.GetRequestStream)
mystreamwriter.Write(strPost)
mystreamwriter.Close()
MessageBox.Show(myRequest.RequestUri.ToString)

' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse
Dim mystream As Stream = myResponse.GetResponseStream
Dim mystreamreader As New StreamReader(mystream)
Do Until mystreamreader.Peek = -1
TextBox1.Text += (mystreamreader.ReadLine.ToString())
Loop
mystreamreader.Close()
mystream.Close()
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12428517
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 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