如何在一次交易中打三次电话?

2024-09-30 01:24:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我有自定义的笔记创建API。它们是设计模型的方式

第一次电话回访

postURL = "http://localhost/api/v1/notes/"
addNote = {
    'title': noteTitle,
    'text' : noteText,
    'location' : noteLocation,
    'lock' : '0',
    'tags' : noteTags
}

这给了notesID

第二次电话会议:

http://localhost/api/v1/notes/images/

  • 上载多个图像

第三次电话会议:

http://localhost/api/v1/notes/videos/

  • 上载多个视频

这是我的密码:

def getAddNote():
    token=getToken()
    noteTitle=input("Enter Note Title: ")
    noteText=input("Enter Note Text: ")
    noteLocation=input("Enter Note Location: ")
    noteTagsInput=input("Enter Note Tags: ")

    tagList = noteTagsInput.split(",")
    print(tagList)
    tagList_=', '.join(map(lambda x: '"' + x + '"', tagList))
    noteTags="["+tagList_+"]"


    postURL = "http://localhost/api/v1/notes/"
    addNote = {
        'title': noteTitle,
        'text' : noteText,
        'location' : noteLocation,
        'lock' : '0',
        'tags' : noteTags
    }

    print(addNote)
    postrequest = requests.post(postURL , headers={'Authorization': 'Token {}'.format(token),'Content-Type': 'application/json'}, data=json.dumps(addNote))

问:有没有一种方法可以在一次交易中进行3次电话回访

我想提交一个从我的客户申请拍摄的图像和视频


Tags: apilocalhosthttpinputnotenotesv1enter

热门问题