Comments (11)
This is something new, as my code is several monts old and it didn't have problems before the name change from ext to contrib.
from restkit.
I don't understand what's the problem. Could you provide full code? What's the expected result against the current result you have?
from restkit.
That's the full code.
The request object at the second line - log.debug(request.params) is pylons request object. From its environ I create a new request to the proxy.
I call the proxy and after that the pylons request is modified, as can be seen in the log. It contains the params of the new request.
This may be the right behavior, as i probably modifies the request in place, instead of creating a new request object, then modifying it.
What I am saying is that this wasn't the case before you changed the "ext" to "contrib".
from restkit.
Hum, I didn't change the way the request object is used from 1.3.1 to 2.0.3 :
http://github.com/benoitc/restkit/compare/1.3.1...2.0.3#diff-15
Are you sure btw you're using the last version ? A warning should appear when you use resp.body now . In 2.0 the behavior of response object has changed and the current response object isn't any more persistent . body_string() and .body_stream() method can be used only one time and it's your responsability if you want to use the body more than one time to save it first (in memory or disk) body = resp.body_string()
for example. Old behavior was problematic under load and large body. A new persistent response object with caching facilities will appear in 2.1 .
Hope this help.
from restkit.
did I answered to your question ?
from restkit.
I am not sure, as resp.body is not the problem as far as I can see. The problem is that the pylons request object gets modified by the proxy.
For now I'm using a workaround - I assign what I need from the pylons request to variables before I call the proxy.
from restkit.
are you using wsgi_proxy as a middleware ? Not suire how you call it here.
from restkit.
Nope, I use it in a regular controller
from restkit.
Can you paste the code you're using (controller + the way you use proxy in ? The example provided is supposed to be used as a full app. To use it as a middleware, you could have some code like this one : http://github.com/benoitc/couchdbkit/blob/master/couchdbkit/wsgi/proxy.py#L12
from restkit.
Here it is: http://friendpaste.com/6IuYG2Qdh0I8SojqFKdMSY
from restkit.
after feedback from irc, I'm closing this issue. Thanks for the tests :)
11:17 benoitc: loxs: you do req.environ['QUERY_STRING'] = 'number=' + str(request.params.get('studioId'))
11:17 benoitc: so it's notmal you lost query args
11:18 loxs: benoitc, is it normal? It didn't use do work like that. I mean, in the past it didn't modify the request.params
11:18 benoitc: rather do req.environ['QUERY_STRING'] += '& number=' + str(request.params.get('studioId'))
11:18 benoitc: well maybe a change in webob
11:19 loxs: maybe
11:19 benoitc: please try it
11:19 loxs: ok
11:21 benoitc: https://bitbucket.org/ianb/webob/src/tip/webob/request.py#cl-582 & https://bitbucket.org/ianb/webob/src/tip/webob/request.py#cl-555
11:22 loxs: yeah, if I append to the query string, of course it works
11:22 loxs: and yes, seems like it changed in webob
from restkit.
Related Issues (20)
- Documentation fails to build with Sphinx 1.2 HOT 1
- Document Error: Mixed case pool object typo in gevent example
- tests being installed in generic "tests" directory HOT 1
- Can't set headers per part of multipart requests HOT 1
- Add documentation on proxy usage
- Auth failed when password contains encoded / (slash)
- testsuite of -4.2.2; errors=6 HOT 1
- wsgi proxy and 'hop by hop' HOT 3
- WSGI proxy and Forwarded header
- un-contrib-ifying the proxy HOT 2
- minor performance optimization concerning location
- data coming out in wrong request HOT 1
- HostProxy misbehaves with spaces in PATH_INFO
- IOError: [Errno 0] Error on write() in tee.TeeInput._tee
- Doesn't Validate TLS HOT 4
- Exception in thread Thread-1 (most likely raised during interpreter shutdown
- no proxy support in restkit oauth? HOT 1
- Documentation for forms.py
- Attaching file to test result in test management 4 jira
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restkit.