Jump to content

Recommended Posts

Posted

Hi!

Here is a vbs script that I want to integrate complete in AutoIt because first of all I don't want to use FileInstall and secondly not on all computers the windows scripting host ist enabled or installed.

This is the script (simplified):

Set objHTTP = CreateObject("MSXML2.XMLHTTP")
Call objHTTP.Open("POST", "http://192.168.0.1/start.login", False)
objHTTP.Send("P1=pass")

Call objHTTP.Open("GET", "http://192.168.0.1/pppctl.cmd?action=1", False)
objHTTP.Send

I don't use vbs and have no idea to convert. For POST and GET methods I searched the help (nothing found) and the forum (thousands of hits but not with a solution for me.

I would be very lucky if you can help me :whistle:

Thx in advance.

Regards,

Buffo

  • Moderators
Posted

Just curious if you've tried the IE.au3 udfs?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

This source may help

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler 
$ResolveTimeout = 5000
$ConnectTimeout = 5000
$SendTimeout = 5000
$ReceiveTimeout = 5000
$sUrl = "http://192.168.0.1/start.login"
$PostData = "P1=pass"
$oHttpRequest = ObjCreate("MSXML2.ServerXMLHTTP")
$oHttpRequest.Open ("POST", $sUrl,True)
$oHttpRequest.setRequestHeader  ("Content-Type", "application/x-www-form-urlencoded") ; Need to change as per your webpage
$oHttpRequest.setRequestHeader  ("Connection", "Keep-Alive")
$oHttpRequest.Send ($PostData)
sleep(1000)
$oHttpRequest = ""

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Posted

Just curious if you've tried the IE.au3 udfs?

I searched in the IE.au3 for "post" and I only get some lines in an example function. If it is possible withe the IE.au3 I would be glad if you can tell me how, I don't know how to :whistle:

@Hasher: Thx a lot I will try both suggestions :D

But one question: The line

$oHttpRequest.setRequestHeader  ("Content-Type", "application/x-www-form-urlencoded"); Need to change as per your webpage

How to find the content-type? It is my router so I didn't make the "webpage" myself :P

Posted

Fiddler will not work for me.

There is a error when I want to access the router page: "Expected is CRLFCRLF returned is LFLF."

Another idea?

Posted

Do you have a webpage with a Form with post function in it already? If so please paste the code..... You can PM if you dont want it posted in public

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...