WinHttpRequest "Push Button"

So, I know how to do this:

    WebBrowser2.Navigate ("")
    WebBrowser2.Document.All.Item("userid").Value = "myuserid"

But how do I do this:

    Dim http As WinHttpRequest
    Set http = New WinHttpRequest

    http.Open "GET", "", "False"

     The above all works fine, then I need to somehow:

     http.Document.All.Item("userid").Value = "myuserid"

Anyone know?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you talking about using the POST method, instead of the GET method?
Dim htpRequest As WinHttp.WinHttpRequest

Set htpRequest = New WinHttp.WinHttpRequest
htpRequest.Open "POST", "", False
htpRequest.Send "userId=myuserid"

Open in new window

You might need to set the SetRequestHeader property too ...
hrolsonsAuthor Commented:
OK, so I set my username & password, how do I click "Submit"?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

The easiest way to figure out what traffic to send is to monitor what happens when you log in manually - I used Fiddler & Internet Explorer to do this.

If you tell me the exact URL you're using to log in, then I should be able to work it out for you.
hrolsonsAuthor Commented:
I will have a look at Fiddler.  I've been using FireBug& Firexox to find the names of the elements.

The site is:
It looks like you need to specify a few more arguments in your POST request.  I'm not sure yet if you need all of these, but this should log you in (it works for me anyway!):
Const WEBSITE As String = ""
Const USERID As String = "UserName"
Const PASSWORD As String = "Password"

Dim htpRequest As WinHttp.WinHttpRequest

Set htpRequest = New WinHttp.WinHttpRequest
htpRequest.Open "POST", WEBSITE, False   ' Synchronously
htpRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
htpRequest.Send "__VIEWSTATE=%2FwEPDwUJOTk0MjUzNjUwD2QWAgIDD2QWAgIBDw8WAh4LTmF2aWdhdGVVcmwFC3NpZ251cC5hc3B4ZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFC2Noa1JlbWVtYmVy6e5Vs%2BpiC56sIiBjrkn4HfS56wI%3D" & _
                "&__EVENTVALIDATION=%2FwEWBwLXz7LSBgLi%2BtIuAuv3gd4CAv2gg9wGAvK94JEPAoznisYGAtHnkYkOkrqdf4hn3msK%2Ba5taAY0gMoCpN8%3D&siteid=1" & _
                "&userid=" & USERID & _
                "&password=" & PASSWORD & _
Debug.Print htpRequest.ResponseText

Set htpRequest = Nothing

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The __VIEWSTATE and __EVENTVALIDATION parameter values are entirely specific to the winkflash website, so you'd have to contact them for their precise meaning - but you can't log in without them.

Let me know if you'd like me to take you through the steps I used to figure this out!  :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.