POST to unsigned HTTPS

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
captainsmackyou
Posts: 11
Joined: 09 Nov 2022, 18:26

POST to unsigned HTTPS

28 Apr 2024, 17:32

I have a home audio solution called Wiim that allows me to control it via simple HTTPS requests. For example:
https://192.168.1.90/httpapi.asp?command=setPlayerCmd:onepause will play or pause the device.

Works fine in a browser as I can just bypass the untrusted certificate error... however, writing an Autohotkey script that disregards the certificate errors and simple sends the request has proven difficult for a programmer at my level. I know how to do this with unsecure HTTP, but I can't figure out for HTTPS.

My question is: what's the simplest way I could perform a POST from my PC to the URL above, without going through external processes of self-signed certificates and such. I just want ahk to Ignore the fact that its an untrusted connection. This script will only ever be used within my four walls by me, so security and best practices aren't extremely important in this particular situation.

I have done some Google searching have have yet to find a simple, self-contained example. Below is my latest failed attempt-- it doesn't generate an error, it just doesn't actually work.

Thank you in advance to anybody that can point me in the right direction.

Code: Select all

$url := "https://192.168.1.90/httpapi.asp?command=setPlayerCmd:onepause"

$oHTTP = ObjCreate("Winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", $url, False)
$oHTTP.SetRequestHeader("Authorization", "Basic" & " " & $auth)
$oHTTP.setRequestHeader("Content-type", "text/uri-list")
$oHTTP.Send()
$responseText = $oHTTP.ResponseText
$responseStatus = $oHTTP.Status


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo, Bing [Bot], RussF, The_One_True_Rick and 110 guests