Solved

VB.Net Web Client and paramaters

Posted on 2013-06-06
9
402 Views
Last Modified: 2013-06-10
My following snippett creates no errors


But I need to pass in a paramater "command" to the url.

How would I do that?

        Dim Client As New WebClient
        Using Client
            Dim reader As New StreamReader(Client.OpenRead("https://hostedconnect.m5net.com/bobl/bobl"), Encoding.UTF8, True)
            Dim line As String = reader.ReadLine()
            Do While line IsNot Nothing
                Debug.WriteLine(line)
                line = reader.ReadLine()
            Loop
        End Using

Open in new window

0
Comment
Question by:lrbrister
  • 4
  • 2
9 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39226685
How does that resource expect its parameters to be received? Via a POST? A GET? For the latter you might try appending a query string:

Dim reader As New StreamReader(Client.OpenRead("https://hostedconnect.m5net.com/bobl/bobl?command=commandValue"), Encoding.UTF8, True)

Open in new window


...For the former, you'll need to use a different method than OpenRead.
0
 

Author Comment

by:lrbrister
ID: 39226803
kaufmed
This is tied toa very difficult project I'm on

I need to POST XML to a url

I then need to get the response...and keep the connection OPEN because this url I'm posting to will send an unlimited stream of data back to me.
The POST comes back with a reply

A few seconds later another block of data will come back

And then as certain events take place in our system...
THEY will send additional data
0
 

Author Comment

by:lrbrister
ID: 39235329
Thanks
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 25

Accepted Solution

by:
kevp75 earned 500 total points
ID: 39235357
Hello,
Yes, you will need to change the way you are accessing the service.  WebClient does not have enough features in it's classes and interfaces to do what you need, it's simply a (no offense intended) lazy-man's approach to making a simple GET request.

http://msdn.microsoft.com/en-us/library/vstudio/ba0z6a33(v=vs.100).aspx

http://stackoverflow.com/questions/14964766/posting-xml-to-web-service-in-net-c-sharp-and-recieving-response

Will show you how to do this.
0
 

Author Comment

by:lrbrister
ID: 39235412
kevp75
  Let me review what you posted.

And absolutely no offense taken.  I am NOT experienced in what I'm trying to do here. You guys are the experts.

And oh yeah...to get answers I am not above groveling :-)
0
 

Author Closing Comment

by:lrbrister
ID: 39235447
Thanks
0
 
LVL 25

Expert Comment

by:kevp75
ID: 39235537
:) Any time, glad I could help
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB.net PaintEventArgs Handling. 10 27
Expando 4 33
Change data in datatable 8 15
File Upload Control on a ASP.NET Overlay Page 1 19
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now