Posting JSON data via Siege?

8,537 views
Skip to first unread message

ep...@opensourceconnections.com

unread,
Apr 9, 2014, 2:06:40 AM4/9/14
to siege...@googlegroups.com
My curl looks like this:

curl 'http://mysever.com/api?echoParams=all&indent=true&start=0' -H 'Content-Type: application/json'  --data-binary '{"param1":"green","param2":"brs"}'


I can't seem to figure out how to get Siege to take that data-binary, I think I saw a post back from 2011 saying "send me a patch"....   Wanted to confirm that is still the truth...

Jeff Fulmer

unread,
Apr 9, 2014, 8:28:04 AM4/9/14
to siege...@googlegroups.com
siege -H 'Content-Type: application/json' -g 'http://mysever.com/api?echoParams=all&indent=true&start=0 POST {"param1":"green","param2":"brs"}' 

Use -g for testing.

Then try:

siege -H 'Content-Type: application/json' -c 10 -r 10 'http://mysever.com/api?echoParams=all&indent=true&start=0 POST {"param1":"green","param2":"brs"}' 

For 10 users ten times.

You can also put your post data in a file and call it this way:

siege -H 'Content-Type: application/json' -g 'http://mysever.com/api?echoParams=all&indent=true&start=0 POST < /home/jeff/mypost.txt

Because POST urls contain spaces before and after POST, you must always quote them at the commandline

Cheers,
Jeff




--
You received this message because you are subscribed to the Google Groups "Siege Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to siege-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages