# Using & authenticating system.net.httpGet() on a gateway

**URL:** <https://forum.inductiveautomation.com/t/using-authenticating-system-net-httpget-on-a-gateway/18799>\
**Category:** Ignition\
**Created:** [July 11, 2018, 8:01pm UTC](https://forum.inductiveautomation.com/t/using-authenticating-system-net-httpget-on-a-gateway/18799 "2018-07-11T20:01:49Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [October 22, 2018, 11:03pm UTC](https://forum.inductiveautomation.com/t/using-authenticating-system-net-httpget-on-a-gateway/18799/11 "2018-10-22T23:03:10Z")

</div>

I’m revisiting this project and have another problem - using system.net.httpGet() from the gateway seems to have a timeout error. I have a UDT with a boolean memory tag, when that tag goes from low to high it runs a shared script that will ideally use httpGet to login to a given gateway URL and get the JSON information as discussed above. In particular, I’m trying to access the gateway the script is on, so nothing should be too odd.

```auto
def signin(urlP):
	url = "http://%s:8088" % urlP
		
	webURL = "/main/web"
	username = 'admin'
	password = 'password'
	
	signinTest = shared.HTTP.checkSignin(url)
	
	retStr = []
	
	
	if signinTest == "":
		retStr.append("signed in")
	else:
		retStr.append( "not signed in: %s" % signinTest )
		retStr.append( "trying signin now" )
		signinResponse = system.net.httpPost(url + webURL + signinTest, {'username': username, 'password': password})
		retStr.append('Signin Response:\n%s' % signinResponse)
		newTest = shared.HTTP.checkSignin(url)
		if newTest == "":
			retStr.append( "signin successful")
		else:
			retStr.append( "signin not successful")
	
	return retStr
	
	
def checkSignin(url, ext=None):
	import re

	ext = ext if ext is not None else "/main/web/status/"
		
	firstGet = system.net.httpGet(url = url + ext)
	
	patternPre = ".*?action=\"\.(.*?)\""
	pattern = re.compile(patternPre, re.DOTALL)
	match = pattern.match(firstGet)
	if match:
		subText = match.group(1)
		return str(subText)
	else:
		return ""

```

This isn’t the most optimized code, but on the ‘firstGet’ assignment in checkSignin I have a timeout error. The same code I use to call signin() works just fine when in the script console, so I think something about the gateway scope makes it different, but I’m not sure why.

---

_[View the full topic](https://forum.inductiveautomation.com/t/using-authenticating-system-net-httpget-on-a-gateway/18799)._
