-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the websnake wiki!
Websnake is a Web requests tool to make life easier when handling more complex scenaries when fetching content from the Web.
It is built on top of Untwisted Framework thus it takes some advantages of Untwisted event driven design. Websnake users would feel more comfortable once a short description of Websnake classes were exposed.
Here it goes.
The class below is responsible for holding the Web Server content. It has data structures that are related to the previously performed request.
websnake.ResponseThis attribute holds the headers that were sent by the Web Server.
Response.headersThe above attribute is an instance of the class.
websnake.HeadersThere is the class below that is a base class for all request methods in websnake.
websnake.RequestEvery Request instance is an event emitter, that means that when events happen then handles are called with specific arguments to characterize the events itself.
In Websnake a Web Server response code is turned into an event thus it is possible to get handles mapped to specific response codes.
Consider the situation that it is necessary to get a callback executed when a server responds with status code 400 and other handle to be called when the server responds with status code 200.
Websnake makes it possible to be done in a simpler but powerful manner.
request = Get(url)
request.add_map('200', handle0)
request.add_map('400', handle1)The class below is responsible for dealing with connections also parsing responses.
ResponseHandle
That is an extension that is responsible for receiving responses and firing its respective events.
The class below makes a Get request.
websnake.GetThe Post request.
websnake.PostThe Put request.
websnake.PutThe Delete request.
websnake.DeleteThe Head request.
websnake.HeadThe next class is used to take action when specific requests are finished.
websnake.RequestPoolThis one is used to dump json through a request.
websnake.JSonThis one is used to send regular form encoded values.
websnake.FormDataUsed to perform basic authentication.
websnake.BasicAuthThe token based authentication.
websnake.TokenAuth