Skip to content
Myr

No mo' HttpError

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 0008b03 · Browse files · 3 files+11 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+11 added−7 removed

  • other:+11 added−7 removed

3 files+11 added−7 removed

modified:requests/__init__.py+1 added-1 removed
21 unmodified lines
22__copyright__ = 'Copyright 2011 Kenneth Reitz'232425from . import utils26from .models import HTTPError, Request, Response26from .models import Request, Response27from .api import request, get, head, post, patch, put, delete28from .sessions import session29from .status_codes import codes30from .exceptions import (
3 unmodified lines
modified:requests/models.py+4 added-3 removed
10 unmodified lines
11import urllib212import socket13import zlib1415from urllib2 import HTTPError15from urlparse import urlparse, urlunparse, urljoin16from datetime import datetime1718from .auth import dispatch as auth_dispatch19from .hooks import dispatch_hook20from .structures import CaseInsensitiveDict21from .packages.poster.encode import multipart_encode22from .packages.poster.streaminghttp import register_openers, get_handlers23from .utils import (dict_from_cookiejar, get_unicode_from_response, stream_decode_response_unicode, decode_gzip, stream_decode_gzip)23from .status_codes import codes24from .exceptions import Timeout, URLRequired, TooManyRedirects25from .monkeys import Request as _Request26from .monkeys import HTTPRedirectHandler27from .utils import (28 dict_from_cookiejar, get_unicode_from_response,29 stream_decode_response_unicode, decode_gzip, stream_decode_gzip)3029from .auth import dispatch as auth_dispatch3132REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)3334
486 unmodified lines
modified:requests/sessions.py+6 added-3 removed
49 unmodified lines
5051class Session(object):52 """A Requests session."""5354 __attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks', 'params', 'config']54 __attrs__ = [55 'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks',56 'params', 'config']575859 def __init__(self,60 headers=None,
2 unmodified lines
63 timeout=None,64 proxies=None,65 hooks=None,66 params=None,65 config=None):67 config=None,68 keep_alive=True):6970 self.headers = headers or {}71 self.cookies = cookies or {}72 self.auth = auth
1 unmodified line
74 self.proxies = proxies or {}75 self.hooks = hooks or {}76 self.params = params or {}77 self.config = config or {}78 self.keep_alive = keep_alive7980 for (k, v) in defaults.items():81 self.config.setdefault(k, v)82
89 unmodified lines
172173 # Send the HTTP Request.174 r.send()175172176 return r.response177178179 def get(self, url, **kwargs):
69 unmodified lines