Solved

VB.Net Web Client and paramaters

Posted on 2013-06-06
9
411 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
[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
  • 4
  • 2
9 Comments
 
LVL 75

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
Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

 
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

623 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