URL Encode POST Data

Several months ago I did a job down south in Sweden – it was a three hour train ride (one way, and I went down and back the same day…) with the fastest train we have in this country. It gave me some time on the train to tinker with things and I didn’t feel like bothering with the “Internet On Train” thing they so fancifully offer these days. I’m not saying that’s a bad idea, I just felt that perhaps me and my Linux laptop would have to spend too much time fighting it to get it up to really enjoy it. Instead I wrote up a patch for curl for a feature we discussed ages ago: send POST data with the command line client that gets URL encoded automatically!cURL

The idea is of course that when you write a simple shell script of some sorts and want to automate POSTs to a web site, it is somewhat complicated to url encode the strings before you pass them on to curl. curl could instead get an option that does it for you.

Fast forward to current time and now I’ve dug up the old patch again, I had a discussion on the mailing list about it and what do you know! Today I’ve posted a patch that introduces –data-urlencode, and I’m very interested in feedback or suggestions on how to polish it further and then to commit it.