MCPcopy
hub / github.com/httpie/cli / start_session

Method start_session

tests/test_sessions.py:73–89  ·  view source on GitHub ↗

Start a full-blown session with a custom request header, authorization, and response cookies.

(self, httpbin)

Source from the content-addressed store, hash-verified

71 """
72
73 def start_session(self, httpbin):
74 """
75 Start a full-blown session with a custom request header,
76 authorization, and response cookies.
77
78 """
79 super().start_session(httpbin)
80 r1 = http(
81 '--follow',
82 '--session=test',
83 '--auth=username:password',
84 'GET',
85 httpbin + '/cookies/set?hello=world',
86 'Hello:World',
87 env=self.env()
88 )
89 assert HTTP_OK in r1
90
91 def test_session_created_and_reused(self, httpbin):
92 self.start_session(httpbin)

Calls 3

httpFunction · 0.85
envMethod · 0.80
start_sessionMethod · 0.45

Tested by

no test coverage detected