Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix

  • Loading branch information...
commit 9194a09e6f6a8755e45a3fd0f880cfb749d7be6e 1 parent 1875771
@benoitc benoitc authored
View
2  restkit/client.py
@@ -332,7 +332,7 @@ def perform(self, request):
# send body
if request.body is not None:
chunked = request.is_chunked()
- if not request.headers.iget('content-length') and \
+ if request.headers.iget('content-length') is None and \
not chunked:
raise RequestError(
"Can't determine content length and " +
View
7 restkit/resource.py
@@ -67,7 +67,8 @@ def __init__(self, uri, **client_opts):
self.uri = urlparse.urlunparse((u.scheme, u.netloc.split("@")[-1],
u.path, u.params, u.query, u.fragment))
- self.client_opts = client_opts
+ self.client_opts = client_opts
+ self.client = Client(**self.client_opts)
def __repr__(self):
return '<%s %s>' % (self.__class__.__name__, self.uri)
@@ -183,8 +184,8 @@ def request(self, method, path=None, payload=None, headers=None,
**self.make_params(params))
# make request
- client = Client(**self.client_opts)
- resp = client.request(uri, method=method, body=payload,
+
+ resp = self.client.request(uri, method=method, body=payload,
headers=self.make_headers(headers))
if resp is None:
View
1  restkit/wrappers.py
@@ -131,7 +131,6 @@ def _get_body(self):
body = property(_get_body, _set_body, doc="request body")
-
class BodyWrapper(object):
def __init__(self, resp, connection):
Please sign in to comment.
Something went wrong with that request. Please try again.