{"id":200,"date":"2007-11-19T13:06:00","date_gmt":"2007-11-19T11:06:00","guid":{"rendered":"http:\/\/daniel.haxx.se\/blog\/2007\/11\/19\/url-encode-post-data\/"},"modified":"2025-11-19T00:29:32","modified_gmt":"2025-11-18T23:29:32","slug":"url-encode-post-data","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2007\/11\/19\/url-encode-post-data\/","title":{"rendered":"URL Encode POST Data"},"content":{"rendered":"\n<p>Several months ago I did a job <a href=\"http:\/\/en.wikipedia.org\/wiki\/H%C3%A4ssleholm\">down south in Sweden<\/a> &#8211; it was a three hour train ride (one way, and I went down and back the same day&#8230;) with the <a href=\"http:\/\/en.wikipedia.org\/wiki\/X_2000\">fastest train we have in this country<\/a>. It gave me some time on the train to tinker with things and I didn&#8217;t feel like bothering with the &#8220;Internet On Train&#8221; thing they so fancifully offer these days. I&#8217;m not saying that&#8217;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!<a href=\"http:\/\/curl.haxx.se\/\"><img decoding=\"async\" src=\"http:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2007\/09\/curl-keywords300.jpg\" title=\"cURL\" alt=\"cURL\" align=\"right\" border=\"0\" hspace=\"8\"><\/a><\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Fast forward to current time and now I&#8217;ve dug up the old patch again, I <a href=\"http:\/\/curl.haxx.se\/mail\/archive-2007-11\/0017.html\">had a discussion on the mailing list<\/a> about it and what do you know! Today I&#8217;ve posted <a href=\"http:\/\/curl.haxx.se\/mail\/archive-2007-11\/0073.html\">a patch that introduces &#8211;data-urlencode<\/a>, and I&#8217;m very interested in feedback or suggestions on how to polish it further and then to commit it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Several months ago I did a job down south in Sweden &#8211; it was a three hour train ride (one way, and I went down and back the same day&#8230;) with the fastest train we have in this country. It gave me some time on the train to tinker with things and I didn&#8217;t feel &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2007\/11\/19\/url-encode-post-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">URL Encode POST Data<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-curl"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":1,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":28606,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/200\/revisions\/28606"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}