Browse Source

UrlLib

pull/3/head
Jure Šorn 6 years ago
parent
commit
ba2ef79dfb
1 changed files with 10 additions and 3 deletions
  1. 13
      README.md

13
README.md

@ -1169,15 +1169,22 @@ wf.close()
``` ```
UrlLib Url
------ ---
### Translate special characters
```python ```python
>>> from urllib.parse import quote, quote_plus, unquote, unquote_plus >>> from urllib.parse import quote, quote_plus, unquote, unquote_plus
```
### Encode
```python
>>> quote("Can't be in URL!") >>> quote("Can't be in URL!")
'Can%27t%20be%20in%20URL%21' 'Can%27t%20be%20in%20URL%21'
>>> quote_plus("Can't be in URL!") >>> quote_plus("Can't be in URL!")
'Can%27t+be+in+URL%21 'Can%27t+be+in+URL%21
```
### Decode
```python
>>> unquote('Can%27t+be+in+URL%21') >>> unquote('Can%27t+be+in+URL%21')
"Can't+be+in+URL!"' "Can't+be+in+URL!"'
>>> unquote_plus('Can%27t+be+in+URL%21') >>> unquote_plus('Can%27t+be+in+URL%21')

|||||||
100:0
Loading…
Cancel
Save