Link to home
Start Free TrialLog in
Avatar of Shiju S
Shiju SFlag for United States of America

asked on

Simulate a Web Form POST Request From VB Application

Hi Experts
  How can we Simulate a Web Form POST Request From VB Application?

;-)
Shiju
SOLUTION
Avatar of DarkoLord
DarkoLord
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shiju S

ASKER

hi
@DarkoLord  
 i am getting sckError while connecting
 i am acceccing via Proxy Server, so need any change in the code ?

@Erick37  ,@connah0047
  i am checking out ur specified links...

Hi
   is it possible to get it done with some API's so that i can make it as Dll ?

;-)
Shiju
Avatar of connah0047
connah0047

Shiju, you should be able to make anything you do into a DLL. I'm not sure how to accomplish what you are trying to do via APIs since you are using a proxy server. I do know that the Mabry control I mentioned DOES support proxying and many more features.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shiju S

ASKER

hi
sorry for the delay

@cem_turk  
thanks for ur comment
i tried ur method
>>webbrowser1.navigate "www.mysite.com/post.php?var1=" & val1 & "&var2=" & val2 & "&var3=" & val3
it doesnt seem to work

Hoping for other  solutions...
Thanks in advance
;-)
Shiju
our "other" method is to open your login page with your webbrowsercontrol then fill the form and submit it from the VB Code

add "Microsoft HTML Object Library" to your project

first we need to navigate to the login page

webbrowser1.navigate "www.blabla.com/login.html"

then fill the form and submit it from a function
 the form layout is very important here i am writing my function for a form like the above one :)

private sub lgn()
dim x as HTMLDocument
x.body.all("p_login").value = "cem_turk"
x.body.all("p_pass").value = "c3m_tu12k"
x.form1.submit
end sub

this code fills your form and submits it :) if you have any difficulties let me see your form so that i can
give you the exact code...

i've forgot to mention that u must be sure that your login page is fully loaded before executing the login function .)
you can use DocumentComplete event of the webbrowser control for this and check the url then call the function...
Avatar of Shiju S

ASKER

hi cem_turk
thanks i will try out ur code and be back soon
;-)
Shiju