From 54240b4811b66dc7d5c2738b91994c21023f0e9e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 13 Feb 2011 16:24:14 -0500 Subject: [PATCH] core update --- requests/core.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/requests/core.py b/requests/core.py index 81f8bc7..f25932e 100644 --- a/requests/core.py +++ b/requests/core.py @@ -9,10 +9,13 @@ :copyright: (c) 2011 by Kenneth Reitz. :license: ISC, see LICENSE for more details. """ + +import httplib import urllib import urllib2 + __title__ = 'convore' __version__ = '0.0.1' __build__ = 0x000001 @@ -41,9 +44,10 @@ class Request(object): raise InvalidMethod() def send(self): - pass - set self.response() + """Sends the request. """ + #set self.response # return True / False + pass class Response(object): @@ -70,18 +74,23 @@ class AuthObject(object): def get(url, params={}, headers={}, auth=None): pass + # return response object def head(url, params={}, headers={}, auth=None): pass + # return response object def post(url, params={}, headers={}, auth=None): pass + # return response object def put(url, data='', headers={}, auth=None): pass + # return response object def delete(url, params={}, headers={}, auth=None): pass + # return response object def add_autoauth(url, authobject): @@ -89,6 +98,18 @@ def add_autoauth(url, authobject): AUTHOAUTHS.append((url, authobject)) + + + +class RequestException(Exception): + """There was an ambiguous exception that occured while handling your request.""" + +class AuthenticationError(RequestException): + """The authentication credentials provided were invalid.""" + +class URLRequired(RequestException): + """A valid URL is required to make a request.""" -class InvalidMethod(Exception): - """An innappropriate method was attempted.""" \ No newline at end of file +class InvalidMethod(RequestException): + """An inappropriate method was attempted.""" + \ No newline at end of file -- 2.34.1