Revision 4910
Added by daigle over 14 years ago
metacat.py | ||
---|---|---|
135 | 135 |
content = "" |
136 | 136 |
conn.close() |
137 | 137 |
return content |
138 |
|
|
139 |
def getRequest(self, queryString): |
|
140 |
conn = httplib.HTTPConnection( self.metacatServer ) |
|
141 |
#params = urllib.urlencode( postdata ) |
|
142 |
#headers = { "Content-type" : "application/x-www-form-urlencoded", |
|
143 |
# "Accept" : "*/*"} |
|
138 | 144 |
|
145 |
# If we have an active session, set the cookie |
|
146 |
#if self.sessionid is not None: |
|
147 |
# headers['Cookie'] = self.sessionid |
|
148 |
|
|
149 |
conn.request( "GET", self.metacatUrlPath + queryString ) |
|
150 |
response = conn.getresponse() |
|
151 |
|
|
152 |
# If metacat responds with a new session id, |
|
153 |
# register it with the metacat client instance |
|
154 |
#setcookie = response.getheader("set-cookie", None) |
|
155 |
#if setcookie: |
|
156 |
# jsid = setcookie.split(';')[0] |
|
157 |
# if jsid[:11] == "JSESSIONID=": |
|
158 |
# self.sessionid = jsid |
|
159 |
|
|
160 |
if response.status == 200: |
|
161 |
content = response.read() |
|
162 |
else: |
|
163 |
print " SERVER DID NOT RETURN 'OK'.... STATUS is " + str(response.status) |
|
164 |
content = "" |
|
165 |
conn.close() |
|
166 |
return content |
|
167 |
|
Also available in: Unified diff
Update load testing scripts