MCPcopy Create free account
hub / github.com/AI45Lab/Code / request_headers

Method request_headers

core/src/mcp/transport/streamable_http.rs:102–114  ·  view source on GitHub ↗

Build request headers including session ID if present.

(&self)

Source from the content-addressed store, hash-verified

100
101 /// Build request headers including session ID if present.
102 async fn request_headers(&self) -> reqwest::header::HeaderMap {
103 let mut map = reqwest::header::HeaderMap::new();
104 map.insert(
105 "Accept",
106 "application/json, text/event-stream".parse().unwrap(),
107 );
108 if let Some(ref sid) = *self.session_id.read().await {
109 if let Ok(val) = reqwest::header::HeaderValue::from_str(sid) {
110 map.insert("Mcp-Session-Id", val);
111 }
112 }
113 map
114 }
115
116 /// Extract and store session ID from response headers.
117 async fn capture_session_id(&self, headers: &reqwest::header::HeaderMap) {

Callers 2

requestMethod · 0.45
notifyMethod · 0.45

Calls 2

insertMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected