up arrow Siege 3.0.3 and URL Encoding

URL encodingURL encoding aka URL escaping aka percent encoding is a mechanism for converting URL characters into a format that can be transmitted by HTTP. Reserved characters are replaced by a hexadecimal value preceded with a ‘%’ which is an escape character. If a URL contains a space, for example, it must be encoded for transmission. Your browser takes a space and reformats it as %20.

Siege, on the other hand, does nothing. It expects you to encode your own damn URLs … that is, until now! Percent encoding is available in siege starting with version 3.0.3-beta2. When it emerges from beta, the first stable version to support this feature will be 3.0.3.

Really? Siege has been around since 1999 and you’re only now adding this feature?

Well, you guys never asked and I haven’t had much need for it. Lately, however, I’ve noticed many of you are asking about json. I suspect URL escaping will be helpful to those folks. Consider this:

siege -g ‘http://www.joedog.org/siege/echo.php?q={ “Hello” : “world” }’

 GET /siege/echo.php?q=%7B%20%22Hello%22%20:%20%22world%22%20%7D HTTP/1.0
 Host: www.joedog.org
 Accept: */*
 User-Agent: JoeDog/1.00 [en] (X11; I; Siege 3.0.3-beta2)
 Connection: close

Booya! Just make sure you single quote the URL like in the example above.

Since URL escaping is in its early stages, I’ve provided a mechanism for disabling it. Inside $HOME/.siegerc add the following: url-escaping = false The default value is true.

Anything else in version 3.0.3-beta2 that we should know about?

Why yes! We changed behavior for -g/–get. When you retrieve a page using -g/–get, siege sets its protocol to HTTP/1.0 so the page is human readable. We don’t need to read chunked encodings and neither do you.

 

H/T: Your JoeDog would like to give a shout out to the folks at wget from whom he completely stole most of the code necessary to implement URL escaping. Cheers.

 

Posted in Applications, Siege | 1 Comment

One Response to “Siege 3.0.3 and URL Encoding”

  1. Alberto says:

    Hi,
    i’m a computer science student and I need a tool that can test a web application.
    In particular i need to perform requests (url get) not concurrently but following an exponential distribution with a specified value of lambda.
    Is it possible to do this with Siege?

Leave a Reply




Recent Comments

  • Jeff Fulmer: Ninety-five percent of the time, this error occurs because you’ve configured more simulated users...
  • Sohan: Hi, Resolved by commenting time parm in siege.rc Cheers
  • Sohan: Hey, My bad. I resolved the issue by setting default time out parm in siege config. I made to 60s as per my...
  • Sohan: Hey, My bad. I did not understand ordering matters for commands in siege from command line. I tried changing...
  • Sohan: Hi, Why the transactions number is always different in siege. Its weird getting always different transaction...