Comments (7)
@mrkkrp Thanks for you effort in making Haskell ecosystem better!
from modern-uri.
Would it be enough, in your option, to state that rendering functions perform percent encoding automatically? I thought it's sort of obvious, because otherwise results of rendering would not be valid URI references.
from modern-uri.
@mrkkrp I'm interested not only in rendering but in parsing. For example, I have such URL:
https://my.youtrack.io/rest/issue?summary=Use `universum` package
And I wonder: whether I need to perform url encoding manually or url encoding is handled automatically by library? I'm working with http-types
and http-client
libraries and behavior of these libraries is very strange... Their functions perform some url encoding while parsing request URI but sometimes they cannot parse request. Thus I need to perform manual url encoding. And that's why I created this issue for more modern package.
from modern-uri.
https://my.youtrack.io/rest/issue?summary=Use `universum` package
That's not a valid URI, because query cannot contain spaces and `
character, they must be percent-encoded to appear in this part of a URI. The modern-uri
package parses URIs according to RFC 3986, it would fail to parse the URI given above, and rightly so. I'm not sure what other packages do, and I'm not sure what could be changed about modern-uri
, because its behavior makes sense (to me, at least).
from modern-uri.
Does my last comment answer your question? It's not clear to me whether I should close this or add something to the docs...
from modern-uri.
@mrkkrp Sorry, I'm not sure how things should work in URLs and in world because I didn't work much with in that area and I'm quite new there. I just was surprised by behavior of one library and couldn't find information about how things done in modern-uri
. When I'm using http-client
library I observe next behavior:
ghci> import Network.HTTP.Client
ghci> parseRequest "https://name.com/issue?title=My `title`&summary=123"
Request {
host = "name.com"
port = 443
secure = True
requestHeaders = []
path = "/issue"
queryString = "?title=My%20%60title%60&summary=123"
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
Here I can see that query string is automatically urlencoded. Well, this doesn't always work for me but that's another story. The thing is that I don't need to perform URL encoding manually. So I would like to see behavior of modern-uri
in case I pass non-urlencoded string to it (like, it fails with exception or returns Nothing
) and I would like to see how already creatde data types with encoded URL will be rendered.
from modern-uri.
I have pushed some clarifications to the docs.
from modern-uri.
Related Issues (20)
- How to concatenate parts of URI? HOT 7
- Use newtypes instead of `RText` HOT 2
- File URIs are not parsed HOT 2
- A URI with a Query such as '?&height=500&width=500' cannot be parsed HOT 2
- Expose parsers of certain classes of URIs HOT 5
- Support for "data:" URI scheme? HOT 12
- Port numbers validation HOT 5
- Add an `updateQueryParams` function HOT 3
- Doesn't build with GHC-9.0
- Compatibility with bytestring 0.11 HOT 2
- Trailing slashes for URLs with no path HOT 2
- Allow `[` and `]` in the query component HOT 6
- Hashable instance HOT 1
- relativeTo and quasi-quotation
- GHC 9.2/TemplateHaskell 2.18 HOT 1
- Bug parsing numeric subdomains HOT 1
- appending paths to urls HOT 3
- Colons in path are escaped HOT 2
- `mkURI` fails to correctly parse uri when hostname contains a "_" HOT 2
- Empty path with a trailing slash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modern-uri.