首页 > 其他 > 详细

接口请求套路

时间:2019-11-06 14:29:28      阅读:57      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

*** 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://dev-ai-class-api-edu.codemao.cn/teacher/system/login headers=${dict2} json=${dict}
  log ${r.json()}

Test02
  Create Session url https://dev-ai-class-api-edu.codemao.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()}

接口请求套路

原文:https://www.cnblogs.com/kaibindirver/p/11804481.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!