Jump to content
Sign in to follow this  
Herb191

_WinHttpSimpleFormFill "Connection problems" error

Recommended Posts

I have a pretty simple question (hopefully). Why am I getting a connection error and how do I fix it?

Thanks.

#include "WinHttp.au3"

$sPage = "/clientdb/PropertySearch.aspx?cid=1"

; Initialize and get session handle
$hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.3; .NET CLR 2.0.50727; ffco7) Gecko/2008092417 Firefox/3.0.3")

; Get connection handle
$hConnect = _WinHttpConnect($hOpen, "propaccess.bellcad.org")

; gets page fine
;$sRead = _WinHttpSimpleRequest($hConnect, Default, $sPage)
;MsgBox(64, "test", $sRead)

; gets a "Connection problems" error when filling the form
;$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "name:Form1", "name:propertySearchOptions:ownerName", "Bob")
$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "index:0", "name:propertySearchOptions:ownerName", "Bob")
If @error Then
    MsgBox(64, "Error", @error)
Else
    MsgBox(64, "", $sRead)
EndIf

; Close connection handle
_WinHttpCloseHandle($hConnect)
; Close session handle
_WinHttpCloseHandle($hOpen)

Share this post


Link to post
Share on other sites

It should probably be more like this:

;...
$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "index:0", _
        "propertySearchOptions_ownerName", "Bob", _
        "propertySearchOptions_searchType", "Owner+Name", _
        "propertySearchOptions_taxyear", "2014", _
        "propertySearchOptions_propertyType", "All", _
        "propertySearchOptions_orderResultsBy", "Owner+Name", _
        "propertySearchOptions_recordsPerPage", "25")

;...

They use geoip check and block anyone outside US, so I can't check.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

It should probably be more like this:

;...
$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "index:0", _
        "propertySearchOptions_ownerName", "Bob", _
        "propertySearchOptions_searchType", "Owner+Name", _
        "propertySearchOptions_taxyear", "2014", _
        "propertySearchOptions_propertyType", "All", _
        "propertySearchOptions_orderResultsBy", "Owner+Name", _
        "propertySearchOptions_recordsPerPage", "25")

;...

They use geoip check and block anyone outside US, so I can't check.

 

Thanks for the response Trancexx. Unfortunately I still get the same error.

Share this post


Link to post
Share on other sites

This works for me (using some US proxy):

$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "index:0", _
        "propertySearchOptions_ownerName", "Bob", _
        "propertySearchOptions_searchType", "Owner Name", _
        "propertySearchOptions_taxyear", "2014", _
        "propertySearchOptions_propertyType", "All", _
        "propertySearchOptions_orderResultsBy", "Owner Name", _
        "propertySearchOptions_recordsPerPage", "25")

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

 

This works for me (using some US proxy):

$sRead = _WinHttpSimpleFormFill($hConnect, "/clientdb/PropertySearch.aspx?cid=1", "index:0", _
        "propertySearchOptions_ownerName", "Bob", _
        "propertySearchOptions_searchType", "Owner Name", _
        "propertySearchOptions_taxyear", "2014", _
        "propertySearchOptions_propertyType", "All", _
        "propertySearchOptions_orderResultsBy", "Owner Name", _
        "propertySearchOptions_recordsPerPage", "25")

That did it thank you. Just for further reference does _WinHttpSimpleFormFill always need to fill in all the fields on a form to work?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Colduction
      Hi AutoIt Members and Programmers, i have a problem with Telegram UDF that does not work on some of my servers, Telegram is not restricted in these machines, here is console output in Windows 7 (Server):
      >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3" /UserParams +>20:20:40 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (4.2.0.0) Keyboard:00000429 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\.NetFramework\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\.NetFramework\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3 +>20:20:40 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\tests\Test.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. Test file for Telegram UDF (https://github.com/xLinkOut/telegram-udf-autoit). This file need a valid ChatID of a Telegram user who has already sent at least a message to the bot, and a valid token given by @BotFather. Insert this data in the source code. "C:\Users\.NetFramework\Desktop\telegram-udf-autoit-master\src\Telegram.au3" (1098) : ==> The requested action with this object has failed.: $oHTTP.Send() $oHTTP^ ERROR ->20:20:41 AutoIt3.exe ended.rc:1 +>20:20:41 AutoIt3Wrapper Finished. >Exit code: 1 Time: 1.56 It's really annoying problem in WinHTTP
    • By triple_N
      Hi again, this is my last option to retrieve file from server via web.
      ; Initialize and get session handle $hOpen = _WinHttpOpen() _writeLog("return $hOpen:" &$hOpen) ; Get connection handle $hConnect = _WinHttpConnect($hOpen, $url, $INTERNET_DEFAULT_HTTPS_PORT) _writeLog("return $hConnect:" &$hConnect) ; Fill the login form: $check_login = _WinHttpSimpleFormFill($hConnect, _ $hOpen, _ "id1", _ "name:LoginForm[userName]", $userID, _ "name:LoginForm[password]", $password,_ "[IGNORE_CERT_ERRORS]") If @error Then _writeLog("login failed : " & @error) _writeLog("check login UIS" &$check_login) ; Close connection handle _WinHttpCloseHandle($hConnect) ; Open new connection handle $hConnect = _WinHttpConnect($hOpen, $url, $INTERNET_DEFAULT_HTTPS_PORT) $s_data = _WinHttpSimpleSSLRequest($hConnect,Default,$Download_url,Default,Default,Default,Default,2) ; BINARY ;$s_data = _WinHttpSimpleSSLRequest($hConnect, Default, $Download_url) _writeLog("return $s_data " &$s_data) ; Close connection handle _WinHttpCloseHandle($hConnect) ; Close session handle _WinHttpCloseHandle($hOpen) ; Open the file for writing (append to the end of a file) and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, 18) If $hFileOpen = -1 Then _writeLog("An error occurred whilst writing the temporary file.") EndIf ;Write the data to the file FileWrite($hFileOpen ,$s_data) FileClose($hFileOpen) However it paused  at 
      _WinHttpSimpleSSLRequest before this received error: 1
      $url = "https://192.168.10.167/ui/login"
      $Download_url https://192.168.10.167/ui/backup/files?3-1.ILinkListener-files-1-download
      Any idea? 
    • By nacerbaaziz
      goodmorning autoit team
      today am comming with some winhttp problems, i hope that you can help me to solve them.
      the first problem
      is when opening a request
      my forums api allow me to delete any post using the api key
      all functions work, i mean post / get
      but when i tried to use the delete verb it's gave me an html 404 error
      here is what am tried
      #include "WinHttp.au3" ; Open needed handles Global $hOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hOpen, "xxxxxxxx.com") ; Specify the reguest: Global $hRequest = _WinHttpOpenRequest($hConnect, "Delete", "/vb/Api/posts/10447/?hard_delete=true", default, default) _WinHttpAddRequestHeaders($hRequest, "XF-Api-Key:xxxxx") _WinHttpAddRequestHeaders($hRequest, "XF-Api-User:xxxxx") ; Send request _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) Global $sHeader = 0, $sReturned = 0 ; If there is data available... If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_CONTENT_DISPOSITION) ;Or maybe: ; $sHeader = _WinHttpQueryHeaders($hRequest, BitOR($WINHTTP_QUERY_RAW_HEADERS_CRLF, $WINHTTP_QUERY_CUSTOM), "Content-Disposition") Do $sReturned &= _WinHttpReadData($hRequest) Until @error msgBox(64, "", $sReturned) endIf ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen)  
      and here is the error message
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access /vb/Api/posts/10447/ on this server.<br /> </p> </body></html>  
      i hope you can help me 
      thanks in advance
    • By Surya
      Hi everyone its been loooong since I posted here 
      I have been trying to convert this curl executable parameters into autoit using the winhttp com object;
      curl -F data_file=@my_audio_file.mp3 -F model=en-US "https://api.speechmatics.com/v1.0/user/41049/jobs/?auth_token=MmQ5MTk4jdsgjhgghstOGU5YS00OWFhLWghdgjshgdhbshj017###" any ideas guys
       
      PS: I am excited to post here after a looong time
    • By Ascer
      Hello
      Opertation Sys: Win7 x64
      Problem: Connecting to webs using TLS 1.1 +
      Description: WinHttp.WinHttpRequest.5.1 using TLS 1.0 by default, i need higher version to connect into some webs.
      Dim $oHttp = ObjCreate("WinHTTP.WinHTTPRequest.5.1") $oHttp.open ("GET", "https://howsmyssl.com/a/check", False) $oHttp.Option(9) = 128 ; 128 - TLS 1.0, 512 - TLS 1.1, 2048 - TLS 1.2, 2056 - TLS 1.1 & TLS 1.2 $oHttp.Send ConsoleWrite($oHttp.responseText & @CRLF) ; at end of the respond you can check your TLS version. Mine is: {"tls_version":"TLS 1.0","rating":"Bad"} Error: $oHttp.Option works only with parameter 128 (TLS 1.0) other values make error {Bad parameter}
      Additional: I've done this tutorial about enabling TLS in registry: <link>
      Thanks for support.
      Ascer
×
×
  • Create New...