API server name could not be resolved Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
thenasos
Posts: 79
Joined: 10 Nov 2015, 10:00

API server name could not be resolved

30 Mar 2017, 08:44

Trying to run API check from:
https://autohotkey.com/boards/viewtopic.php?t=14850

Getting error:
'The server name or address could not be resolved'
--> oHTTP.Send()

Did not change anything:

Code: Select all

URL := "http://rt.easter-eggs.org/demos/4.2/REST/1.0/ticket/777/show?user=admin&pass=admin"
 
oHTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
;Post request
oHTTP.Open("GET", URL , False)
oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0")
oHTTP.SetRequestHeader("Referer", URL)
oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
oHTTP.SetRequestHeader("Accept-Encoding", "gzip, deflate, br")
oHTTP.SetRequestHeader("Connection", "Keep-Alive")

;Send POST request
oHTTP.Send()
;Get received data
Gui, Add, Edit, w800 r30, % oHTTP.ResponseText
Gui, Add, Edit, w800 r30, % oHTTP.GetAllResponseHeaders
Gui, Show
return
 
GuiClose:
ExitApp
Shrek is love...
User avatar
tomoe_uehara
Posts: 210
Joined: 05 Oct 2013, 12:37
Contact:

Re: API server name could not be resolved  Topic is solved

30 Mar 2017, 12:44

Hello, your script works and it gives me this reply:

Code: Select all

RT/4.2.12-50-ga2e2d37 200 Ok

id: ticket/777
Queue: Marketing
Owner: Nobody
Creator: mike.bar
Subject: Das ist ein test mbk
Status: new
Priority: 0
InitialPriority: 0
FinalPriority: 0
Requestors: [email protected]
Cc:
AdminCc:
Created: Fri Feb 26 05:32:16 2016
Starts: Not set
Started: Not set
Due: Not set
Resolved: Not set
Told: Not set
LastUpdated: Thu Sep 15 09:14:35 2016
TimeEstimated: 0
TimeWorked: 0
TimeLeft: 0
CF.{F1}: 
CF.{F2}: 
CF.{F3}: 
CF.{F4}: 
You can check your firewall setting.
User avatar
thenasos
Posts: 79
Joined: 10 Nov 2015, 10:00

Re: API server name could not be resolved

30 Mar 2017, 15:32

tomoe_uehara wrote:Hello, your script works and it gives me this reply:

Code: Select all

RT/4.2.12-50-ga2e2d37 200 Ok

id: ticket/777
Queue: Marketing
Owner: Nobody
Creator: mike.bar
Subject: Das ist ein test mbk
Status: new
Priority: 0
InitialPriority: 0
FinalPriority: 0
Requestors: [email protected]
Cc:
AdminCc:
Created: Fri Feb 26 05:32:16 2016
Starts: Not set
Started: Not set
Due: Not set
Resolved: Not set
Told: Not set
LastUpdated: Thu Sep 15 09:14:35 2016
TimeEstimated: 0
TimeWorked: 0
TimeLeft: 0
CF.{F1}: 
CF.{F2}: 
CF.{F3}: 
CF.{F4}: 
You can check your firewall setting.
Yep, did run it from home pc, works great, office firewall changes, sight...
Shrek is love...
User avatar
thenasos
Posts: 79
Joined: 10 Nov 2015, 10:00

Re: API server name could not be resolved

31 Mar 2017, 03:29

Adding proxy settings solved the issue.

Code: Select all

oHTTP.SetProxy( 2, "someproxy.com:80")
Shrek is love...

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Chunjee, Googleye, jarhead, leehere10, mikeyww, roonyroox, RubbeH, w0z, william_ahk and 61 guests