私は最近 Python を始めました。JSON 文字列をエンコードし、それを HTTP リクエストとして URL に送信し、レスポンスを解析する方法についてのコードを投稿していただけないでしょうか。
ここに私が遊んでいるいくつかのコードがあります:
import os
import json
if os.name == 'nt':
def clear_console():
subprocess.call("cls", shell=True)
return
else:
def clear_console():
subprocess.call("clear", shell=True)
return
def login_call(username, password):
choice = 0
while int(choice) not in range(1,2):
clear_console()
print ('')
print (' Json Calls - Menu')
choice = input('''
1. Login.
Enter Option: ''')
print ('')
choice = int(choice)
if choice == 1:
login_call(username, password)