You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm observing an issue with wreq-0.5.4.0, where I'd like to avoid URL encoding parameters for some servers that don't handle it very well. Say I'd like to set a parameter foo=bar,baz, and I'd like to send these parameters to the request without URL encoding.
There seems to be no way to do this with wreq. Using param seems to url encode the set parameters before they are sent.
Here's a repro:
-- set params.
λ>let opts =Wreq.defaults &Wreq.param "foo".~ [ "bar,baz" ]
-- lets see what we have:
λ> opts
Options { manager =Left _, proxy =Nothing, auth =Nothing, headers = [("User-Agent","haskell wreq-0.5.4.0")], params = [("foo","bar,baz")], redirects =10, cookies =Just (CJ {expose =[]}) } -- no URL encoding yet , or at least not when `show` is called.-- lets trigger an error so that the request gets logged.
λ>Wreq.getWith opts "https://apibeta.centralapp.com/api/v2/no/such/path"-- will respond with a 404.***Exception:HttpExceptionRequestRequest {
host ="apibeta.centralapp.com"
port =443
secure =True
requestHeaders = [("User-Agent","haskell wreq-0.5.4.0")]
path ="/api/v2/no/such/path"
queryString ="?foo=bar%2Cbaz"-- params have been URL encoded.
method ="GET"
proxy =Nothing
rawBody =False
redirectCount =10
responseTimeout =ResponseTimeoutDefault
requestVersion =HTTP/1.1
proxySecureMode =ProxySecureWithConnect
}
Now I've retried this with plain http-client with versions;
As you can see, http-client doesn't URL encode the parameters, but wreq seems to be doing that. Server logs also confirm this.
Is there a way to avoid this? That is, set parameters with and without URL encoding?
What I've tried so far: swapping out the default manager with one generated via Network.HTTP.Client.TLS.newTlsManager assuming the encoding was happening in the manager, but that has had no effect.
The text was updated successfully, but these errors were encountered:
I'm observing an issue with
wreq-0.5.4.0
, where I'd like to avoid URL encoding parameters for some servers that don't handle it very well. Say I'd like to set a parameterfoo=bar,baz
, and I'd like to send these parameters to the request without URL encoding.There seems to be no way to do this with
wreq
. Usingparam
seems to url encode the set parameters before they are sent.Here's a repro:
Now I've retried this with plain
http-client
with versions;And the behaviour is different:
As you can see,
http-client
doesn't URL encode the parameters, butwreq
seems to be doing that. Server logs also confirm this.Is there a way to avoid this? That is, set parameters with and without URL encoding?
What I've tried so far: swapping out the default manager with one generated via
Network.HTTP.Client.TLS.newTlsManager
assuming the encoding was happening in the manager, but that has had no effect.The text was updated successfully, but these errors were encountered: