Files
httprunner/tests/httpbin/upload.yml
2018-08-02 11:29:01 +08:00

23 lines
615 B
YAML

- config:
name: test upload file with httpbin
request:
base_url: $HTTPBIN_SERVER
- test:
name: upload file
variable_binds:
- field_name: "file"
- file_path: "LICENSE"
- file_type: "text/html"
- multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)}
request:
url: /post
method: POST
headers:
Content-Type: ${multipart_content_type($multipart_encoder)}
data: $multipart_encoder
validators:
- eq: ["status_code", 200]
- startswith: ["content.files.file", "MIT License"]