Is there a plugin for that or do I need to script something in Python?
Much appreciated
Code: Select all
URL = http:\\"SOME.URL.HERE" (leave the double quotes alone)
import urllib2 as urllib
try:
response = urllib.urlopen(URL)
print response
except urllib2.HTTPError as err:
print err
Code: Select all
URL = http:\\"user:passwd@ip:port\dev\sps\io\SetVariable\test"
import urllib2 as urllib
try:
response = urllib.urlopen(URL)
print response
except urllib2.HTTPError as err:
print errThe URL should be formatted normally, i.e like this:V_J wrote:I was trying to use the webserverplugin to send something to a different webserver, but failed. Now, I tried this one and it gives me a syntax error...Syntax error is in the first line... I have a username without password for that server, but it also gives syntax error. If I do not put a username, it should not work due to lack of authentication, but I still get syntax error on the first line.... Any thoughts?Code: Select all
URL = http:\\"user:passwd@ip:port\dev\sps\io\SetVariable\test" import urllib2 as urllib try: response = urllib.urlopen(URL) print response except urllib2.HTTPError as err: print err
Code: Select all
URL = "http://user:passwd@ip:port/dev/sps/io/SetVariable/test"Code: Select all
URL = "http:\\user:passwd@ip:port\dev\sps\io\SetVariable\test"
import urllib2
try:
response = urllib2.urlopen(URL)
print response
except urllib2.HTTPError as err:
print err
Code: Select all
URL = "http://www.google.com"
import urllib2
try:
print urllib2.urlopen(URL).read()
except urllib2.HTTPError as err:
print 'urllib2 Webpage Error: ', str(err)