RT
借鉴了@debugtalk大大的解决方案 :
https://github.com/HttpRunner/HttpRunner/issues/169
不知道哪里写的不对,纠结好久了,求指点,谢谢
代码和报错如下
test_case

- test:
    name: test_cloudinary_images_post
    variable_binds:
      - field_name: "file"
      - file_path: ${ENV(image_path)}
      - file_type: "image/jpeg"
      - - multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)}
    base_url: ${ENV(base_url_sg_stag)}
    request:
      url: /api/cloudinary_images
      method: POST
      headers:
        Content-Type: ${multipart_content_type($multipart_encoder)}
      data: $multipart_encoder
    validate:
      - eq: ["status_code", 200]
    setup_hooks:
      - ${setup_hook_basicauth($request)}

error

httprunner 和 python 版本


↙↙↙阅读原文可查看相关链接,并与作者交流