from gi.repository import GLib, Soup

session = Soup.Session()

def _queue_callback(session, msg, user_data):
	if msg.status_code == 200:
		print "GOT REPLY"
		session.queue_message(msg, _queue_callback, None)
	else:
		print "WHAT?"

msg = Soup.Message.new("GET", "http://127.0.0.1:8421")
session.queue_message(msg, _queue_callback, None)

def do_print():
	print "Somethign is weird"
	return True

GLib.timeout_add(1000, do_print)

mainloop = GLib.MainLoop()
mainloop.run()
