Comments (6)
That's quite interesting, I'll surely give it a look.
Most of the time I've come across URLs with trailing slashes, keeping or removing them made no difference, so I thought it generally meant the same thing.
Thanks for the suggestion!
from buildurl.
It depends on a convention;) E.g. Django has trailing slash convention and redirects urls without TS to the ones with TS. But only if it's enabled in config and when it's not, the request will result in 404.
from buildurl.
I've added this feature. While working on it, I considered also adding support for more than one slash separating path elements, like https://example.com/one//two/
, but it seems to be even less common, and to do that I'd have to rework a bunch of the logic for handling the path.
Thanks again for the idea!
Would you like to be added to the All Contributors list?
from buildurl.
Thank you very much and no contribution is needed:)
Although two slashes are valid in url i've never seen anyone using it on purpose but we never know:)
I have few more usability suggestions so i will create few more tickets if you dont mind:)
Or you can inspire here on your own. It's a php library but the way how one can work with urls is something that i really miss in python. I rewrote it to python once but never published because it depends on Django and i was lazy to write tests for it:) If you want you can check the code here and use it as you please.
from buildurl.
I'll take a look at those, thanks again!
Oh, and you might want to take a look at furl, it's pretty similar to BuildURL, but more well-known, and might be more complete.
When I created BuildURL, it was actually inside another project, but it grew a bit and I split it to its own project, but back then I didn't know furl existed.
Only recently have I come across it, and I almost gave up on BuildURL, but this is my first-ish open-source project, and I really like it, so I'll keep it around and keep improving it.
I'm yet to write some better documentation, but I'll likely reference furl there so people can take a look at that too and choose which one they want to use.
from buildurl.
Hehe, furl - i have totally forgotten about the library. I was using it few years ago but i have a feeling that there had been something i didn't like about it. And when i was searching for some url library recently, it didn't appear in results while your did:) But thanks for the reminder:)
from buildurl.
Related Issues (11)
- [Info] General Info
- [FEAT/BUG] Automatically convert arguments of path/query to string HOT 3
- [FEAT] Fluent interfaces HOT 1
- [FEAT] Using *arg resp **kwargs for add_path resp add_query HOT 1
- [FEAT] trailing_slash argument to __init__() HOT 1
- Add reference to furl HOT 1
- Creating a URL without a scheme, then adding one, results in `scheme:///url`, with 3 `/`
- Alternatives
- [placeholder]
- [placeholder]
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 buildurl.