(ctx: Context)
| 14 | }; |
| 15 | |
| 16 | pub fn create_http_module(ctx: Context) -> ModuleKind { |
| 17 | let name = ctx.intern(b"std.http"); |
| 18 | |
| 19 | let exports = [ |
| 20 | ("get", Value::NativeFunction(NativeFn(http_get))), |
| 21 | ("post", Value::NativeFunction(NativeFn(http_post))), |
| 22 | ("put", Value::NativeFunction(NativeFn(http_put))), |
| 23 | ("delete", Value::NativeFunction(NativeFn(http_delete))), |
| 24 | ("patch", Value::NativeFunction(NativeFn(http_patch))), |
| 25 | ("head", Value::NativeFunction(NativeFn(http_head))), |
| 26 | ] |
| 27 | .into_iter() |
| 28 | .map(|(name, f)| (ctx.intern_static(name), f)) |
| 29 | .collect(); |
| 30 | |
| 31 | ModuleKind::Native { name, exports } |
| 32 | } |
| 33 | |
| 34 | fn parse_headers( |
| 35 | headers: HashMap<InternedString, Value, BuildHasherDefault<AHasher>>, |
no test coverage detected