How send this HTTP command using VB2010

Hello all
I'm very new to Visual Basic and I would just like to create a Private sub that when I call from another part of the programme is simply sends out this HTTP post,
http://192.168.1.200:8088/api/?Function=FadeToBlack&Duration=100
 that's all it is to do nothing else, I do not need to read anything or do anything else just return.
is there a nice simple way of achieving this I've looked at Google for the last three or four hours and I am lost.
Any help would be much appreciated
LetchfordPAsked:
Who is Participating?
 
ste5anSenior DeveloperCommented:
First of all: Should it really be a POST or a GET?

Use a WebRequest.

E.g.

Imports System.Net

Module Module1

    Sub Main()

        Dim myWebRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
        myWebRequest.Method = "GET" ' or "POST"
        Dim myWebResponse As WebResponse = myWebRequest.GetResponse()

    End Sub

End Module

Open in new window

0
 
LetchfordPAuthor Commented:
Hi ste5an
That is just right works a treat. Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.