-
-
Save bunlongheng/b23d775ee7b106cd7cc0ae5ac71b81a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
print ("______________\n") | |
print " 1.GET " | |
print " 2.POST " | |
print " 3.PUT " | |
print " 4.DELETE " | |
print ("______________\n") | |
http = int(raw_input("Select your option : ")) | |
url = raw_input("Paste Your URL : ") | |
if not http: | |
http = 3 | |
if http == 1: | |
cmd = 'curl '+ url | |
elif http == 2: | |
data = raw_input("Paste Your Data : ") | |
cmd = 'curl -g -X POST -H "Content-Type:application/json" -d \''+data+'\' ' + url | |
elif http == 3: | |
data = raw_input("Paste Your JSON Data: ") | |
cmd = 'curl -g -X PUT -H "Content-Type:application/json" -d \''+data+'\' ' + url | |
else: | |
cmd = 'curl -g -X DELETE ' + url | |
print ("_________________________________________\n") | |
print '\n' | |
print cmd | |
print '\n' | |
print ("_________________________________________\n") | |
run = raw_input("Do you want to run it ? [y/n]: ") | |
print '\n' | |
if run == 'y': | |
os.system(cmd+'\n') | |
print '\n' | |
else: | |
os.system("clear") | |
sys.exit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment