*** Settings ***
Library requests
Resource resource.robot
Library Collections
Library RequestsLibrary
*** Test Cases ***
Test
${dict} Create Dictionary username liukaibin password 123456
#输出变量
log ${dict}
#创建字典
${dict2} Create Dictionary Content-Type ${heard}
log ${dict2}
${r} requests.post https://class-api-edu.yoyo.cn/teacher/system/login headers=${dict2} json=${dict}
log ${r.json()}
Test02
Create Session url https://api-edu.yoyo.cn
#赋值变量
${yy} Set Variable {"username":"liukaibin","password":"123456"}
#转换成json数组
${uu} To json ${yy}
#创建字典
${dict2} Create Dictionary Content-Type ${heard}
${resp} Post Request url /teacher/system/login headers=${dict2} json=${uu}
log ${resp.json()}