0

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, e.g. send my users browser to my required address, with the correct params inside the post request?

madjar
  • 11,343
  • 2
  • 38
  • 52
Crooksey
  • 868
  • 3
  • 10
  • 21

0 Answers0