summaryrefslogtreecommitdiff
path: root/ext/node/ops/http.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-10-07 17:34:03 +0200
committerGitHub <noreply@github.com>2023-10-07 21:04:03 +0530
commitedeccef4990598620bf5595df6fc8c1b1b1a7f73 (patch)
tree6a14ba0113fed8c3afd4e5ffe94617bd0fa1648b /ext/node/ops/http.rs
parentbe7e2bd8c1883c6bf58db8ff40954ed7ee53b5c5 (diff)
refactor: migrate more ops to op2 macro (#20808)
Getting closer...
Diffstat (limited to 'ext/node/ops/http.rs')
-rw-r--r--ext/node/ops/http.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/node/ops/http.rs b/ext/node/ops/http.rs
index 2a4d31f50..40ef6df32 100644
--- a/ext/node/ops/http.rs
+++ b/ext/node/ops/http.rs
@@ -2,7 +2,7 @@
use deno_core::error::type_error;
use deno_core::error::AnyError;
-use deno_core::op;
+use deno_core::op2;
use deno_core::url::Url;
use deno_core::AsyncRefCell;
use deno_core::ByteString;
@@ -23,13 +23,14 @@ use reqwest::header::CONTENT_LENGTH;
use reqwest::Body;
use reqwest::Method;
-#[op]
+#[op2]
+#[serde]
pub fn op_node_http_request<P>(
state: &mut OpState,
- method: ByteString,
- url: String,
- headers: Vec<(ByteString, ByteString)>,
- client_rid: Option<u32>,
+ #[serde] method: ByteString,
+ #[string] url: String,
+ #[serde] headers: Vec<(ByteString, ByteString)>,
+ #[smi] client_rid: Option<u32>,
has_body: bool,
) -> Result<FetchReturn, AnyError>
where