Benign cargo Download

request.rs

Rust test marker or harnessimports http
SHA-256d2323bfa5d2ff68389c8c19dea290decfaefd5916b6d6c621a914e6ca0533df0

Evidence

imports http lines 1–19
1use std::fmt;
2#[cfg(feature = "compat")]
3use std::mem::replace;
4use std::net::SocketAddr;
5
6#[cfg(feature = "compat")]
7use http;
8
9use header::Headers;
10use proto::{Body, MessageHead, RequestHead, RequestLine};
11use method::Method;
12use uri::{self, Uri};
13use version::HttpVersion;
14
15/// An HTTP Request
⋯4 lines
HTTP chunked transfer encoding literal in source lines 98–108
98:30… equest.
99 ///
100 /// By default, the body will be sent using `Transfer-Encoding: chunked`. To
101 /// override this behavior, manually set a [`ContentLength`] header with the
102 /// length of `body`.
103 #[inline]
104 pub fn set_body<T: Into<B>>(&mut self, body: T) { self.body = Some(body.into()); }
105
106 /// Set that the URI should use the absolute form.
107 ///
108 /// This is only needed when talking to HTTP/ …
#[cfg(test)] attribute lines 193–205
⋯4 lines
197}
198
199#[cfg(test)]
200mod tests {
201 /*
⋯4 lines
HTTP Content-Length header literal in source lines 220–231
220:21…
221 }
222
223 fn assert_no_body(s: &str) {
224 assert!(!s.contains("Content-Length:"));
225 assert!(!s.contains("Transfer-Encoding:"));
226 }
227
228 #[test]
229 fn test_get_empty_body() {
230 let req = Request::with_connector(
231 Get, Url::parse("http://example.dom").unw …
Raw HTTP safe-method request line in source lines 303–308
303:12… s = from_utf8(&bytes[..]).unwrap();
304 let request_line = "GET http://example.dom/ HTTP/1.1";
305 assert_eq!(&s[..request_line.len()], request_line);
306 assert!(s.contains("Host: example.dom"));
307 }
308 */

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.