Package shttp :: Module http
[hide private]
[frames] | no frames]

Module http

source code

Classes [hide private]
  CustomResponse
  HttpCgiError
  HttpMethodError
  HTTPWriteWrapper
  HTTPRequestHandler
  VirtualHost
  HTTPServer
Functions [hide private]
 
getrequest()
Returns the spyro's request dictionary that rules the current thread or shttp.http request.
source code
 
getthreaddata() source code
 
setheader(header) source code
 
_setrequest(data) source code
 
_delrequest() source code
 
getkwargs(httpreq, environment) source code
 
webmethodwrite(httpreq, res, returntype, headers=(), options={})
|headers| can be one of the following:
source code
 
webmethod(httpreq, environment, method, returntype='text/plain') source code
 
getcookiespyroauth(authcookiename, environment) source code
 
webspyro(spyroserver, httpreq, environment, returntype='text/plain', authcookiename='SPyRO_AuthMethod') source code
 
httpcall(realhandler, returntype='text/plain')
Creates a lexical closure to execute a function with query_string and post requests as function arguments |realhandler| The handler of the call |returntype| The return type of the function to be placed as Content-Type header
source code
 
httpcallspyro(spyroserver, returntype='text/plain', authcookiename='SPyRO_AuthMethod')
Creates a lexical closure to execute a function with query_string and post requests as function arguments |spyroserver| The SPyRO server to the call If the proper authorization policies aren't disabled (policy 'can_follow_objname'): /SPyRO/Chart/Bar/Draw /SPyRO -> Registered URL base to spyroserver /Chart -> Object /Bar -> A property of /Chart /Draw -> A method of /Bar |returntype| The return type of the function to be placed as Content-Type header Note: If httpcall is used as decorator the declared function will be replaced, use regcall of http object as decorator.
source code
Variables [hide private]
  __thread_data__ = {}
  warn = warn.Warn("shttp.http")
Function Details [hide private]

getrequest()

source code 
Returns the spyro's request dictionary that rules the current thread or shttp.http request. If this thread is not ruled by an http request, it will raise a KeyError exception

webmethodwrite(httpreq, res, returntype, headers=(), options={})

source code 
|headers| can be one of the following:
  • A dictionary
  • A tuple/list of tuple/list of two elements
  • A tuple/list of a string per entry
  • A mixin of the previous two

httpcall(realhandler, returntype='text/plain')

source code 

Creates a lexical closure to execute a function with query_string and post requests as function arguments |realhandler| The handler of the call |returntype| The return type of the function to be placed as Content-Type header

Note: If httpcall is used as decorator the declared function will be replaced, use regcall of http object as decorator.