How To Write Python Script For Rest Api