Skip to content

Commit d039cb2

Browse files
committed
Mention CurlURL in README.
1 parent fce0430 commit d039cb2

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,35 @@ async def main():
6363
asyncio.run(main())
6464
```
6565

66+
## URL Utilities
67+
68+
RedC includes a high-performance URL parser powered by libcurl.
69+
70+
```python
71+
from redc import CurlURL
72+
73+
u = CurlURL("https://user:pass@example.com:8080/path?q=1#frag")
74+
75+
print(u.host) # example.com
76+
print(u.port) # 8080
77+
print(u.path) # /path
78+
79+
u.query = None
80+
u["port"] = 443
81+
82+
print(str(u))
83+
# https://user:pass@example.com:443/path#frag
84+
```
85+
86+
Validate URLs:
87+
88+
```python
89+
from redc import CurlURL
90+
91+
print(CurlURL.is_valid_url("https://example.com")) # True
92+
print(CurlURL.is_valid_url("::::invalid::::")) # False
93+
```
94+
6695
## License
6796

6897
MIT [LICENSE](https://github.com/AYMENJD/redc/blob/main/LICENSE)

0 commit comments

Comments
 (0)