Newcomer to django so bere with me here…
In my django app one of my urls accepts a paramater called receipt. I need to retrieve the receipt from the url and post it to a external web service. No database is involved in any of this. To user simply goes to http://myapp.com/receipt?=receipt=somereceipt . I read the receipt and then post it to a external web service.
I implemented this by using urllib2 and it works fine.
Is there a better way to make post requests from Django, or is using urllib2 ok? Will urllib2 scale to many requests?
Thanks,
-David
urllib2sounds like a completely reasonable way to solve your problem. However you might want to take a look at therequestslibrary: http://docs.python-requests.org/en/v0.10.7/index.html It wrapsurllib2so that you can make the HTTP requests you want and maintain your sanity.