0

I am creating a simple script that simplifies an SMS bash command.

in bash the command looks like this:

curl http://textbelt.com/text -d number=0000000000 -d "Message=Test01"

The problem is, when I put that into python it looks like this:

import os
os.system('curl http://textbelt.com/text -d number=9803554314 -d "Message=Test01"')

I get the error:

"success": false,

"message": "Number and message parameters are required."

How do is use double quotes?

Rushy Panchal
  • 16,979
  • 16
  • 61
  • 94

1 Answers1

0

Change Message to message (lower case) and it should work:

Your example fails:

os.system('curl http://textbelt.com/text -d number=9803554314 -d "Message=Test01"') { "success": false, "message": "Number and message parameters are required." }0

Changed M to m on "Message" works:

import os os.system('curl http://textbelt.com/text -d number=9803554314 -d "message=Test01"') { "success": true }0

Hope that helps

mojojojo
  • 16
  • 3