From: Jeff Tanner Date: 2012-09-22T14:41:36+09:00 Subject: "percent-encoding" and "application/x-www-form-urlencoded" Hi From wikipedia on "percent-encoding": http://en.wikipedia.org/wiki/Percent-encoding "Percent-encoding, also known as URL encoding, ... is also used in the preparation of data of the "application/x-www-form-urlencoded" media type." With the following code, do I need to make "requestContent" "percent-encoded" by calling "CGI.escape()"?; request = Net::HTTP::Post.new(uri.request_uri) request.body = requestContent request["Content-Type"] = "application/x-www-form-urlencoded" Here is an example of "requestContent" value: {"username":"third_party_int@bluefish.com","password":"redfish"} Which when making it "percent-encoded" using "CGI.escape()": %7B%22username%22%3A%22third_party_int%40bluefish.com%22%2C%22password%22%3A%22redfish%22%7D If I send "requestContent" as is (without making it "percent-encoded") to the remote service endpoint expecting "urlencoded", then the service request succeeds. However, if I do make "requestContent" to be "percent-encoded" by calling "CGI.escape()", then the service request fails. Curious, with the declaration of "request["Content-Type"] = "application/x-www-form-urlencoded"", is this making "request.body" to be "percent-encoded", and that is why I do not need to assign a "percent-encoded" value? Thanks - Jeff in Seattle If I do not use CGI.escape upon -- Posted via http://www.ruby-forum.com/.