MCPcopy Create free account
hub / github.com/apify/impit / form_to_bytes

Function form_to_bytes

impit-python/src/request.rs:48–58  ·  view source on GitHub ↗
(data: HashMap<String, String>)

Source from the content-addressed store, hash-verified

46}
47
48pub fn form_to_bytes(data: HashMap<String, String>) -> Vec<u8> {
49 let mut body = Vec::new();
50 for (key, value) in data {
51 body.extend_from_slice(urlencoding::encode(key.as_str()).as_bytes());
52 body.extend_from_slice("=".as_bytes());
53 body.extend_from_slice(urlencoding::encode(value.as_str()).as_bytes());
54 body.extend_from_slice("&".as_bytes());
55 }
56 body.pop(); // Remove the last "&"
57 body
58}

Callers 2

requestMethod · 0.85
requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…