码迷,mamicode.com
首页 > 其他好文 > 详细

接口请求套路

时间:2019-11-06 13:01:29      阅读:87      评论:0      收藏:0      [点我收藏+]

标签:test   json   ble   mic   pass   ESS   数组   com   图片   

技术图片

 

 

*** 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()}

接口请求套路

标签:test   json   ble   mic   pass   ESS   数组   com   图片   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!