Python 'requests' hide params (in post)

I am using the python Requests libary: http://docs.python-requests.org/en/latest/ (inside my pyramid web application).

I can post data to a url, with params in the url, however I cannot seem to pass data hidden in the post request.

My code:

import requests

data = {
'callback': callback, 'req_cv2': req_cv2, 'digest': digest, 'order': order, 'amount': amount, 
'trans_id': trans_id, 'merchant': merchant, 'remote_password': remote_password,
}

r = requests.post(post_addr, params=data)

return Response(status_int=302, location=r.url)

The above works perfectly, but I don't want all my data in the url

I create a request session with my data hidden in the request

s = requests.Session()
a = s.post(post_addr, data=data)
print a
<Response [200]>

Now my question is, how can I return this with pyramid, eg send my users browser to my required address, with the correct params inside the post request?

链接地址: http://www.djcxy.com/p/71948.html

上一篇: 金字塔self.request.POST为空

下一篇: Python'请求'隐藏参数(在后)