X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fhttp.py;h=20593b87ae233bbaa4ac5a0690fb760d2b6640d8;hb=74341f044cb996f8002ba8f66f4ab0de765098a3;hp=11ddca6d9891d970dd6a3d55bd464937c26cec0d;hpb=017c4fb032ab1f63e1ce474e12787204f33fce96;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/http.py b/osmclient/sol005/http.py index 11ddca6..20593b8 100644 --- a/osmclient/sol005/http.py +++ b/osmclient/sol005/http.py @@ -48,16 +48,11 @@ class Http(http.Http): http_code = curl_cmd.getinfo(pycurl.HTTP_CODE) #print 'HTTP_CODE: {}'.format(http_code) curl_cmd.close() - if http_code == 204: - return None - elif http_code == 404: - if data.getvalue(): - return json.loads(data.getvalue().decode()) - else: - return "NOT FOUND" + # TODO 202 accepted should be returned somehow if data.getvalue(): - return json.loads(data.getvalue().decode()) - return "Failed" + return http_code, json.loads(data.getvalue().decode()) + else: + return http_code, None def send_cmd(self, endpoint='', postfields_dict=None, formfile=None, filename=None,