Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

url - How to send a POST request to an external link via python

I am trying to integrate a payment gateway in my app, and I'm using Django. However, the payment gateway needs to get a POST request done to their site.

In the payment gateways' docs they show the following...

<form method="post" action="https://sandbox.payhere.lk/pay/checkout">   
    <input type="hidden" name="merchant_id" value="1232">   
    <input type="text" name="currency" value="LKR">
    <input type="text" name="amount" value="1000">  
    <input type="submit" value="Buy Now">   
</form>

Even though this works perfectly fine, I feel this is a security vulnerability since people can alter the amount. In which I need to send a POST request via Django views to https://sandbox.payhere.lk/pay/checkout containing the info {"merchant_id":"1232", "currency":"LKR", "amount":"1000"}.

Is there any way in which I could do it? Thanks!

question from:https://stackoverflow.com/questions/65843579/how-to-send-a-post-request-to-an-external-link-via-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...