How to Send SMS using HTTP API in Python Code?

import urllib # Python URL functions
import urllib2 # Python URL functions

user = "UR_USER" # Your authentication key.

key = "UR_KEY" # Your authentication key.

mobile = "+919974984500" # Multiple mobiles numbers separated by comma.

message = "Test Message" # Your message to send.

senderid = "SENDER" # Sender ID,While using route4 sender id should be 6 characters long.

accusage = "default" # Define route

# Prepare you post parameters
values = {
          'user' : user,
          'key' : key,
          'mobile' : mobile,
          'message' : message,
          'senderid' : senderid,               
          'accusage' : accusage
          }


url = "http://temp.91bulksms.com/submitsms.jsp?" # API URL
                      
postdata = urllib.urlencode(values) # URL encoding the data here.
                  
req = urllib2.Request(url, postdata)
                    
response = urllib2.urlopen(req)
              
output = response.read() # Get Response
                 
print output # Print Response