POST JPG

12 views
Skip to first unread message

Baptiste S.

unread,
May 21, 2018, 4:12:22 PM5/21/18
to Siege Users
Hi,

I need to load test a REST API. 

endpoint can receive 2 photos :

photo1 : File form component
photo2 : File form component

corresponding curl would be :

curl 'https://XXXXXXX/' -H 'Origin: https://XXXXXXXX' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,fr;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundarynyzBBC9AQWFnd6dI' -H 'Accept: application/json' -H 'Cache-Control: no-cache' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: https://xXXXXXXX/' -H 'DNT: 1' --data-binary $'------WebKitFormBoundarynyzBBC9AQWFnd6dI\r\nContent-Disposition: form-data; name="file[0]"; filename="PHOTO1.jpg"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundarynyzBBC9AQWFnd6dI\r\nContent-Disposition: form-data; name="file[1]"; filename="PHOTO2.jpg"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundarynyzBBC9AQWFnd6dI--\r\n' --compressed


Is it possible to do so with siege ?

I have been spending hours trying to get the command line right : 

siege --content-type "multipart/form-data; boundary=----WebKitFormBoundaryx4TEnV3z8bWgkIR3" "https://XXXX/ POST photo1=PHOTO1.jpg&photo2=PHOTO2 " -d1 -r10 -c10 --header "Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiaWF0IjoxNTI2OTI5MjgxLCJleHAiOjE1MjcwMTU2ODF9.qaXjbDUVgNvQNgEvIBIkjJk5Y87yyOciEa8YYnARmmY" 


 
Reply all
Reply to author
Forward
0 new messages