zoukankan      html  css  js  c++  java
  • 接口请求套路

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

  • 相关阅读:
    杨辉三角
    手动实现md5加密
    戳气球
    重构字符串
    四数相加 II
    背包问题 II
    组合总和 IV
    背包问题 V
    背包问题
    Win 10安装Python及环境变量配置
  • 原文地址:https://www.cnblogs.com/kaibindirver/p/11804481.html
Copyright © 2011-2022 走看看