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
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Lib
import Network.HTTP.Simple
req1 = parseRequest_ "https://host.com/method/messages.send?keyboard=\"\""
req2 = parseRequest_ "https://host.com/method/messages.send?keyboard={\"buttons\":true}"
req3 = parseRequest_ "https://host.com/method/messages.send?keyboard={\"buttons\":[{\"prop\":\"val\"}]}"
main :: IO ()
main = putStrLn "main"
Hello! I try to parse URL where one of parameters is a JSON with a nested list of objects.
parseRequest throws exception on req3 in this code.
In req3 URL is incorrect, because of symbols, that can't be part of URL, but maybe parser can correctly encode by himself.
Think it's a bug. Check it please.
The text was updated successfully, but these errors were encountered:
This doesn't appear to be a bug, it looks like you have incorrectly escaped query string parameters. I'd recommend using a library for properly building up URLs that handles escaping correctly.
But one thing still embarrassing me.
That's when I use setRequestQueryString to set same JSON string to one of the parameters, it's works with no exceptions. It makes me think, that parser must do the same thing with a string.
Function req4 works right.
Hello! I try to parse URL where one of parameters is a JSON with a nested list of objects.
parseRequest throws exception on req3 in this code.
In req3 URL is incorrect, because of symbols, that can't be part of URL, but maybe parser can correctly encode by himself.
Think it's a bug. Check it please.
The text was updated successfully, but these errors were encountered: