Functions
samweb_client.misc Namespace Reference

Functions

def serverInfo (samweb, authenticate=False)
 

Function Documentation

def samweb_client.misc.serverInfo (   samweb,
  authenticate = False 
)
Get information about the server.
arguments:
    authenticate : force SSL connection. (default False)

Definition at line 8 of file misc.py.

8 def serverInfo(samweb, authenticate=False):
9  """ Get information about the server.
10  arguments:
11  authenticate : force SSL connection. (default False)
12  """
13  kwargs = {}
14  if authenticate: kwargs['secure'] = True
15  response = samweb.getURL('', **kwargs)
16  if 'json' in response.headers.get('Content-Type',''):
17  return response.json()
18  else:
19  return response.text.rstrip()
20 
def serverInfo(samweb, authenticate=False)
Definition: misc.py:8