I have a curl request and i don't know how to transform it in jmeter :
curl -H application-id:my-app-id -H secret-key:my-secret-key -H Content-Type:"multipart/form-data" -H application-type:REST --form upload=@/logo.jpg -X POST -v http://localhost:8080/api/v1/files/Photos/logo.jpg
What is the best way of doing this?
The curl package is pre-installed on most Linux distributions today. To check whether the Curl package is installed on your system, open up your console, type curl , and press enter. If you have curl installed, the system will print curl: try 'curl --help' or 'curl --manual' for more information .
Option 1: Record the request
In JMeter:
In console:
curl -x localhost:8888 -H application-id:my-app-id ......
Option 2: Building Request Manually
Add HTTP Request sampler and configure it as follows:
localhost
8080
POST
/api/v1/files/Photos/logo.jpg
Use multipart/form-data
for POSTupload
as Parameter Name and image.jpg
as MIME TypeAdd HTTP Header Manager and provide your headers names and values there
References:
For JMeter 5.1 or higher. There is an easier solution for creating test plan from curl just like in Postman
Tools
→ Import from curl
→ Paste your curl into the box → Create Test Plan
In some older version, the path can be:
Help
→ Import from curl
→ Paste your curl into the box → Create Test Plan
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With