Skip to content

Commit

Permalink
Added Megan Emurayama to authors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed May 14, 2011
1 parent 9b0bb87 commit b1e28c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Patches and Suggestions
- Rob Madole
- Aram Dulyan
- Johannes Gorset
- 村山めがね (Megan Emurayama)
14 changes: 8 additions & 6 deletions requests/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,28 @@ class Request(object):
def __init__(self, url=None, headers=dict(), files=None, method=None,
data=dict(), auth=None, cookiejar=None, timeout=None):

socket.setdefaulttimeout(timeout)

self.url = url
self.headers = headers
self.files = files
self.method = method
self.data = {}

socket.setdefaulttimeout(timeout)

# self.data = {}
if hasattr(data, 'items'):
for (k, v) in data.items():
self.data.update({
k.encode('utf-8') if isinstance(k, unicode) else k:
v.encode('utf-8') if isinstance(v, unicode) else v
})
# url encode data if it's a dict

# url encode data if it's a dict
if hasattr(data, 'items'):
self._enc_data = urllib.urlencode(self.data)
else:
self._enc_data = self.data
self._enc_data = data


self.response = Response()

Expand Down Expand Up @@ -210,8 +214,6 @@ def send(self, anyway=False):

if not self.sent or anyway:



try:
opener = self._get_opener()
resp = opener(req)
Expand Down

0 comments on commit b1e28c7

Please sign in to comment.