You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let k = k.cast_as::<PyString>(py)?.to_string_lossy(py).to_string();
167
+
let v = ifletOk(v) = v.cast_as::<PyString>(py){
168
+
vec![ v.to_string_lossy(py).to_string()]
169
+
} else {
170
+
// TODO: deal with a matcher or a list
171
+
vec![]
172
+
};
173
+
query_map.insert(k, v);
174
+
}
175
+
if !query_map.is_empty(){
176
+
interaction.request.query = Some(query_map);
177
+
}
178
+
} else if query.get_type(py).name(py) != "NoneType"{
179
+
returnErr(PyErr::new::<exc::TypeError, _>(py, format!("with_request: Query parameters must be supplied as a Dict, got '{}'", query.get_type(py).name(py))));
180
+
}
181
+
182
+
ifletOk(headers) = headers.cast_as::<PyDict>(py){
183
+
letmut header_map = hashmap!{};
184
+
for(k, v) in headers.items(py){
185
+
let k = k.cast_as::<PyString>(py)?.to_string_lossy(py).to_string();
186
+
let v = ifletOk(v) = v.cast_as::<PyString>(py){
187
+
vec![ v.to_string_lossy(py).to_string()]
188
+
} else {
189
+
// TODO: deal with a matcher or a list
190
+
vec![]
191
+
};
192
+
header_map.insert(k, v);
193
+
}
194
+
if !header_map.is_empty(){
195
+
interaction.request.headers = Some(header_map);
196
+
}
197
+
} else if headers.get_type(py).name(py) != "NoneType"{
198
+
returnErr(PyErr::new::<exc::TypeError, _>(py, format!("with_request: Headers must be supplied as a Dict, got '{}'", headers.get_type(py).name(py))));
199
+
}
200
+
201
+
let file = fs::read(file_path).map(|data| OptionalBody::Present(Bytes::from(data),None));
0 commit comments