Answer the question
In order to leave comments, you need to log in
What error can I get when making a POST request?
I want to send sms to my phone using my sms provider's API, but I couldn't find any documentation for it.
At the request, I seem to have correctly specified the parameters, but an error occurs that the "text" parameter is not set
def sendSMS(tel):
tel = int(re.search(r'\d+', tel).group()) # tel without +
URL_SMS = "https://information.mobitel.uz/admin/api"
API_SMS = "XrAZ_2kMwbxFGUxHj8RpeisKNIVyxxxx"
headers_sms = {"LOGIN_SMS": "orient", "PSW_SMS": "Uq5z5dfb"}
sms_code = randint(1000, 9999)
random = "Code: " + str(sms_code)
data_sms = {"key": API_SMS, "phone": tel, "text": "hello"}
send = requests.post(URL_SMS, json=data_sms)
responseData = send.json()
print(random)
print(json.dumps(responseData, indent=4, sort_keys=True, ensure_ascii=False))
return "test"
Answer the question
In order to leave comments, you need to log in
Is there a requirement for a minimum line length? less than 6 characters means an empty string. It sounds crazy, of course, but on the other hand, what to expect from a provider that does not document API functions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question