If you are trying to execute the HTTP POST data x-www-form-urlencoded , urlEncodeVars may not be the right choice. The urlEncodeVars function urlEncodeVars not match the application / x-www-form-urlencoded coding algorithm in two aspects, which is worth mentioning:
- it encodes a space like
%20 instead of + - it encodes
* as %2A instead of *
Note the comment next to the function in Network.HTTP.Base :
-- Encode form variables, useable in either the -- query part of a URI, or the body of a POST request. -- I have no source for this information except experience, -- this sort of encoding worked fine in CGI programming.
For an example of suitable coding, see this function in the hspec-wai package.
source share