contrib Package¶
console
Module¶
-
restkit.contrib.console.
as_bool
(value)¶
-
restkit.contrib.console.
external
(cmd, data)¶
-
restkit.contrib.console.
indent
(mimetype, data)¶
-
restkit.contrib.console.
indent_json
(data)¶
-
restkit.contrib.console.
indent_xml
(data)¶
-
restkit.contrib.console.
main
()¶ function to manage restkit command line
-
restkit.contrib.console.
options
()¶ build command lines options
-
restkit.contrib.console.
prettify
(response, cli=True)¶
-
restkit.contrib.console.
update_defaults
(defaults)¶
ipython_shell
Module¶
webob_api
Module¶
Subclasses of webob.Request who use restkit to get a webob.Response via restkit.ext.wsgi_proxy.Proxy.
Example:
>>> req = Request.blank('http://pypi.python.org/pypi/restkit')
>>> resp = req.get_response()
>>> print resp
200 OK
Date: ...
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Server: Apache/2...
<?xml version="1.0" encoding="UTF-8"?>
...
-
class
restkit.contrib.webob_api.
Method
(name)¶ Bases:
property
-
class
restkit.contrib.webob_api.
Request
(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)¶ Bases:
webob.request.Request
-
delete
¶
-
get
¶
-
get_response
()¶ Like
.call_application(application)
, except returns a response object with.status
,.headers
, and.body
attributes.This will use
self.ResponseClass
to figure out the class of the response object to return.If
application
is not given, this will send the request toself.make_default_send_app()
-
head
¶
-
post
¶
-
put
¶
-
set_url
(url)¶
-
webob_helper
Module¶
-
exception
restkit.contrib.webob_helper.
WebobResourceError
(msg=None, http_code=None, response=None)¶ Bases:
webob.exc.WSGIHTTPException
Wrapper to return webob exceptions instead of restkit errors. Usefull for those who want to build WSGI applications speaking directly to others via HTTP.
To do it place somewhere in your application the function wrap_exceptions:
wrap_exceptions()
It will automatically replace restkit errors by webob exceptions.
-
message
¶
-
status_int
¶ The status as an integer
-
-
restkit.contrib.webob_helper.
wrap_exceptions
()¶ wrap restkit exception to return WebBob exceptions
wsgi_proxy
Module¶
-
class
restkit.contrib.wsgi_proxy.
HostProxy
(uri, **kwargs)¶ Bases:
restkit.contrib.wsgi_proxy.Proxy
A proxy to redirect all request to a specific uri
-
extract_uri
(environ)¶
-
-
class
restkit.contrib.wsgi_proxy.
Proxy
(manager=None, allowed_methods=['GET', 'HEAD', 'POST', 'PUT', 'DELETE'], strip_script_name=True, **kwargs)¶ Bases:
object
A proxy wich redirect the request to SERVER_NAME:SERVER_PORT and send HTTP_HOST header
-
extract_uri
(environ)¶
-
-
class
restkit.contrib.wsgi_proxy.
TransparentProxy
(manager=None, allowed_methods=['GET', 'HEAD', 'POST', 'PUT', 'DELETE'], strip_script_name=True, **kwargs)¶ Bases:
restkit.contrib.wsgi_proxy.Proxy
A proxy based on HTTP_HOST environ variable
-
extract_uri
(environ)¶
-
-
restkit.contrib.wsgi_proxy.
get_config
(local_config)¶ parse paste config
-
restkit.contrib.wsgi_proxy.
make_host_proxy
(global_config, uri=None, **local_config)¶ HostProxy entry_point
-
restkit.contrib.wsgi_proxy.
make_proxy
(global_config, **local_config)¶ TransparentProxy entry_point