Skip to content

Commit

Permalink
Rename bodyproducer to data_to_body_producer as per review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cyli committed Jul 8, 2015
1 parent ca78637 commit 7e9d15c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions treq/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ def deliverBody(self, protocol):


class HTTPClient(object):
def __init__(self, agent, cookiejar=None, bodyproducer=IBodyProducer):
def __init__(self, agent, cookiejar=None,
data_to_body_producer=IBodyProducer):
self._agent = agent
self._cookiejar = cookiejar or cookiejar_from_dict({})
self._bodyproducer = bodyproducer
self._data_to_body_producer = data_to_body_producer

def get(self, url, **kwargs):
return self.request('GET', url, **kwargs)
Expand Down Expand Up @@ -162,7 +163,7 @@ def request(self, method, url, **kwargs):
headers.setRawHeaders(
'content-type', ['application/x-www-form-urlencoded'])
data = urlencode(data, doseq=True)
bodyProducer = self._bodyproducer(data)
bodyProducer = self._data_to_body_producer(data)

cookies = kwargs.get('cookies', {})

Expand Down

0 comments on commit 7e9d15c

Please sign in to comment.