add doc for request.cookies_str_to_dict

Author:    Prodesire <Prodesire@yeah.net>
This commit is contained in:
Prodesire 2018-12-10 21:39:22 +08:00
parent 1922b2de27
commit 3ee18155ec
2 changed files with 28 additions and 0 deletions

View File

@ -66,3 +66,17 @@ Update query params of given url and return new url.
>>> update_query_params('http://example.com', {'foo': 1}) >>> update_query_params('http://example.com', {'foo': 1})
'http://example.com?foo=1' 'http://example.com?foo=1'
``` ```
## request.cookies_str_to_dict
```python
cookies_str_to_dict(cookies)
```
Convert cookies from str to dict.
```python
>>> from pydu.request import cookies_str_to_dict
>>> cookies_str_to_dict('a=a;b=b')
{'a': 'a', 'b': 'b'}
```

View File

@ -62,3 +62,17 @@ update_query_params(url, params)
>>> update_query_params('http://example.com', {'foo': 1}) >>> update_query_params('http://example.com', {'foo': 1})
'http://example.com?foo=1' 'http://example.com?foo=1'
``` ```
## request.cookies_str_to_dict
```python
cookies_str_to_dict(cookies)
```
将字符串类型的Cookies转换为字典对象。
```python
>>> from pydu.request import cookies_str_to_dict
>>> cookies_str_to_dict('a=a;b=b')
{'a': 'a', 'b': 'b'}
```