AnsweredAssumed Answered

vrf Using HTTP and POSTDATA

Question asked by VRFuser on Sep 24, 2002
Hi guys


Clearly, there is a Agilent Example coming with the VEE Pro installation which shows how to make a ActiveX window control ShDocVw.Webbrowser display a URL (homepage of Agilent). This might be useful but I have another trouble. I have a remotecontrolled power switch (ePowerSwitch) which is controlled via HTTP POSTs (there is a webinterface for websurfers, but I want to do it in VEE of course).


There are 3 options to control the switch from VEE:

- Depend on ActiveX component ShDocVw available in current install
- Depend on ActiveX component msinet (Internet Transfer) which is not really available,
  but is the one recommended by the ePowerSwitch programming guide for Visual Basic
  and Delphi (inet.execute...)
- Manage without ActiveX and emulate HTTP POSTs and GETs via VEE's I/O sockets


I would rather write code only using the Sockets to get independant from ActiveX components.
I have trouble to do this:

- Emulate traffic via sockets (seems to get thru, but what happens???)

To host xxx.xxx.xxx.xxx, socket 80, as a text array:

0000: POST econtrol.html HTTP/1.0
0001: From: switchdriver@versystem.ericsson.se
0002: User-Agent: HTTPTool/1.0
0003: Content-Type: application/x-www-form-urlencoded
0004: Content-Length:  4
0005:
0006: P4=t"

- Also trouble to use these ActiveX calls:

WebBrowser_V.Navigate("http://xxx.xxx.xxx.xxx/econtrol.html",,"P4=t");


I would clearly go for the VEE-socket-solution if it worked. Maybe I am missing something in the DATA to the http server? But what troubles me too is that the ActiveX-code displayed above does not seem to pass the POSTDATA-argument to the webpage. Try for yourself - add the ShDocVw and aim the Navigate-function for the WebBrowser_V control to GOOGLE (www.google.com/search) and add POSTDATA "q=agilent" and see if GOOGLE seems to receive the POSTDATA...


Thanks in advance for all advice or solutions!!!

/Tomas


---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes