-
How HTTP servers/libs could work
This is more a brainstorming session than anything else. J2EE has been killing me of late and I’ve been trying to explain to coworkers how Node.js/Connect and Ruby/Rails work differently
HTTP Server
- You should always be able to access the response and request.
- You should always have access to a session identifier if it exists and be able to remove it.
- Resource Mapping should consist of mapping urls to resources. A resource should be a static file or a controller. In order to support generic controllers, variables may be extractable from a URL. Static resources should be cached and listened to for changes!
- There should be an easy way to listen and post to a web socket in addition to subscribing to open/close events
- There should be a way to intercept a static file or controller request
The above rules should be the sole extent of an Http Server.
HTTP Utilities:
- There should be an easy way to extract HTML Form data from a request.
- There should be an easy way to extract POST data from a request.
- There should be an easy way to add cookies to a response and retrieve cookies from a request.
- There should be an easy way to urlize and de-urlize a string
Container Utilities:
- There should be an easy way to extract JSON and XML from a String
- There should be an easy way to stream bits in from a request and out to a response
- There should be an easy way to Map a Dictionary of List of String to and from HTML form data
- There should be an easy way to associate data with a session, and delete a session