Files
httprunner/tests/httpbin/upload.yml
2019-12-12 17:35:31 +08:00

19 lines
519 B
YAML

- config:
name: test upload file with httpbin
base_url: ${get_httpbin_server()}
- test:
name: upload file
variables:
file_path: "data/test.env"
multipart_encoder: ${multipart_encoder(file=$file_path)}
request:
url: /post
method: POST
headers:
Content-Type: ${multipart_content_type($multipart_encoder)}
data: $multipart_encoder
validate:
- eq: ["status_code", 200]
- startswith: ["content.form.file", "data/test.env"]