Skip to content

Commit ce2eee0

Browse files
committed
demonstrate json
1 parent 78d0d1b commit ce2eee0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/http.cookies.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ The following example demonstrates how to use the :mod:`http.cookies` module.
316316
>>> print(C)
317317
Set-Cookie: number=7
318318
Set-Cookie: string=seven
319+
>>> import json
319320
>>> C = cookies.SimpleCookie()
320-
>>> C.load('cookies=7; mixins="{"chips": "dark chocolate"}"; state="gooey"')
321+
>>> C.load(f'cookies=7; mixins="{json.dumps({"chips": "dark chocolate"})}"; state=gooey')
321322
>>> print(C)
322323
Set-Cookie: cookies=7
323324
Set-Cookie: mixins="{"chips": "dark chocolate"}"

0 commit comments

Comments
 (0)