ComObj POST

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
iCyd
Posts: 2
Joined: 28 Apr 2022, 11:14

ComObj POST

Post by iCyd » 05 Feb 2023, 23:32

Hey, how can I use ComObj to make a POST Request in V2?
When I use this v1 Code it always says This variable appears to never be assigned a value (http Variable).

Code: Select all

try {
			http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
			url := "https://api.pushed.co/1/push"

			http.Open("POST", url, false)
			http.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
			http.SetRequestHeader("Referer", url)
			http.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")

			http.Send("app_key=" appKey "&app_secret=" appSecret "&target_type=app&content=" msg)
		} catch e {
		}

User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: ComObj POST

Post by kczx3 » 06 Feb 2023, 09:08

Changes from v1.1 to v2.0 wrote: ComObject(CLSID) creates a ComObject; i.e. this is the new ComObjCreate.

Post Reply

Return to “Ask for Help (v2)”