Note that there are some explanatory texts on larger screens.

plurals
  1. POpython microframeworks and the requests library
    primarykey
    data
    text
    <p>Working on a side project in python that both initiates http requests and has a small web server. It got me thinking - it seems like every python microframework has its own model for accessing properties of the http request (e.g. the underlying request object that you can use to get at the querystring parameters, headers, etc. and the underlying response object for setting the status code, response headers, etc). They all allow you access to the same data and they've all kind of re-invented the wheel.</p> <p>Are there any microframeworks that use the <code>Request</code> and <code>Response</code> objects from the popular <a href="http://docs.python-requests.org/en/latest/" rel="nofollow">requests</a> library instead of having their own implementation? It seems like the requests library is becoming the canonical way to do http requests in python, so this would make a framework especially minimal. It would also be cool when making apps that essentially glue other services together because forwarding/wrapping requests would be trivial. You could just change the <code>.url</code> attribute on the incoming request and call <code>.prepare()</code> to forward the request (yes, for simple forwarding doing it at the webserver level makes more sense, but you get the idea).</p> <p>Or if there aren't any frameworks that do this in particular, are there any with similar benefits i.e. the incoming http request object also works as an http client?</p> <p>Edit: Wanted to point out that this is how the http Request object works in Go, that's partly what inspired my question. From the <a href="http://golang.org/pkg/net/http/#Request" rel="nofollow">net/http</a> library "A Request represents an HTTP request received by a server or to be sent by a client."</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload