Skip to content

Commit 3ee1815

Browse files
committed
add doc for request.cookies_str_to_dict
Author: Prodesire <[email protected]>
1 parent 1922b2d commit 3ee1815

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/request.md

+14
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,17 @@ Update query params of given url and return new url.
6666
>>> update_query_params('http://example.com', {'foo': 1})
6767
'http://example.com?foo=1'
6868
```
69+
70+
71+
## request.cookies_str_to_dict
72+
```python
73+
cookies_str_to_dict(cookies)
74+
```
75+
76+
Convert cookies from str to dict.
77+
78+
```python
79+
>>> from pydu.request import cookies_str_to_dict
80+
>>> cookies_str_to_dict('a=a;b=b')
81+
{'a': 'a', 'b': 'b'}
82+
```

docs/zh-cn/request.md

+14
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ update_query_params(url, params)
6262
>>> update_query_params('http://example.com', {'foo': 1})
6363
'http://example.com?foo=1'
6464
```
65+
66+
67+
## request.cookies_str_to_dict
68+
```python
69+
cookies_str_to_dict(cookies)
70+
```
71+
72+
将字符串类型的Cookies转换为字典对象。
73+
74+
```python
75+
>>> from pydu.request import cookies_str_to_dict
76+
>>> cookies_str_to_dict('a=a;b=b')
77+
{'a': 'a', 'b': 'b'}
78+
```

0 commit comments

Comments
 (0)