URL encoding in Grinder 3
June 07, 2009
Grinder 3 is awesome no doubt about it!
Grinder 3 also adheres to W3C recommendations to encode requests as if everything is in UTF-8, meaning that if you pass parameter values in other than UTF-8 encoding then Grinder will send garbage. This is hardcoded and can be seen in the Grinder 3 source (god bless open source … amen). The explanation is also a comment from the source.
The only way to make Grinder 3 to encode requests using the deprecated way is to follow this procedure:
- Get the Grinder source from here
- Extract it
- Find the class HTTPClient.Codecs
- Lines #667 and #695 have the interesting code
- Open a simple Java project in your favored IDE which is Eclipse of course
- Create the package HTTPClient
- Put the Codecs class in it
- Add grinder.jar to the Build Path
- Modify lines #667 and #695 as you see fit.
- Pickup the compiled .class from bin directory of the project
- Put the .class file inside the grinder.jar which you are using
- Use it
This will make TCPProxy to record correctly non-UTF8 request bodies, enable to send a request with parameters encoded in anything.
Enjoy!














