diff --git a/parse_rest/connection.py b/parse_rest/connection.py index eac0310..5ac2d9c 100644 --- a/parse_rest/connection.py +++ b/parse_rest/connection.py @@ -67,7 +67,7 @@ class ParseBase(object): ENDPOINT_ROOT = API_ROOT @classmethod - def execute(cls, uri, http_verb, extra_headers=None, batch=False, body=None, **kw): + def execute(cls, uri, http_verb, extra_headers=None, batch=False, _body=None, **kw): """ if batch == False, execute a command with the given parameters and return the response JSON. @@ -88,10 +88,10 @@ def execute(cls, uri, http_verb, extra_headers=None, batch=False, body=None, **k master_key = ACCESS_KEYS.get('master_key') url = uri if uri.startswith(API_ROOT) else cls.ENDPOINT_ROOT + uri - if body is None: + if _body is None: data = kw and json.dumps(kw, default=date_handler) or "{}" else: - data = body + data = _body if http_verb == 'GET' and data: url += '?%s' % urlencode(kw) data = None diff --git a/parse_rest/datatypes.py b/parse_rest/datatypes.py index d77e0b0..1930d80 100644 --- a/parse_rest/datatypes.py +++ b/parse_rest/datatypes.py @@ -225,7 +225,7 @@ def save(self, batch=False): raise ParseError("Files can't be overwritten") uri = '/'.join([self.__class__.ENDPOINT_ROOT, self.name]) headers = {'Content-type': self.mimetype} - response = self.__class__.POST(uri, extra_headers=headers, batch=batch, body=self._content) + response = self.__class__.POST(uri, extra_headers=headers, batch=batch, _body=self._content) self._file_url = response['url'] self._name = response['name'] self._api_url = '/'.join([API_ROOT, 'files', self._name])