Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set multiple headers with Siege?

I want to use siege to target a number of URLs on my app, each with different headers. I can set headers for one request

siege -u http://localhost/xyz -d1 -r1000 -c25 --header="Token: f2840fc1"

(this appears to be undocumented)

I can specify a list of URLs in the URL file, with custom headers for each URL. But I can't see a way in the docs.

like image 965
Joe Avatar asked Dec 20 '13 15:12

Joe


People also ask

How do I add multiple headers in Xmlhttprequest?

If you want to set multiple headers, then call setRequestHeader multiple times. Don't add extra arguments to the first call. Save this answer.


1 Answers

I suggest using two concurrent calls to siege. Write a URL file that uses Header-A, and another for Header-B.

For my API testing, I've got a get_urls.txt file and post_json_urls.txt file, which I call on two instances of Siege at once. This way one gets called with Content-Type: text/json and the other doesn't. Short of rewriting the Siege url parser, this is the only way I know to do it.

For example:

siege -f get_urls.txt & siege -H 'Content-Type: text/json' -f post_json_urls.txt
like image 173
Joseph Lust Avatar answered Oct 25 '22 05:10

Joseph Lust