MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / get_request

Method get_request

aiscript-runtime/src/endpoint.rs:203–225  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

201 }
202
203 fn get_request(&self) -> HashMap<&'static str, Value> {
204 let uri = self.request.uri();
205 [
206 ("method", self.request.method().as_str().into()),
207 if let Some(authority) = uri.authority() {
208 ("authority", authority.as_str().into())
209 } else {
210 ("authority", serde_json::Value::Null)
211 },
212 if let Some(host) = uri.host() {
213 ("host", host.into())
214 } else {
215 ("host", serde_json::Value::Null)
216 },
217 ("path", uri.path().into()),
218 ("query", uri.query().into()),
219 ("protocol", uri.scheme_str().into()),
220 ("port", uri.port_u16().into()),
221 // ("fragment", uri.fragment().into()),
222 ]
223 .into_iter()
224 .collect()
225 }
226
227 fn get_header(&self) -> HashMap<String, Value> {
228 self.request

Callers 1

pollMethod · 0.80

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected