Permalink
Browse files

fix

  • Loading branch information...
1 parent 1875771 commit 9194a09e6f6a8755e45a3fd0f880cfb749d7be6e @benoitc benoitc committed Feb 18, 2011
Showing with 5 additions and 5 deletions.
  1. +1 −1 restkit/client.py
  2. +4 −3 restkit/resource.py
  3. +0 −1 restkit/wrappers.py
View
@@ -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
@@ -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
@@ -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):

0 comments on commit 9194a09

Please sign in to comment.