diff --git a/bin/main.ml b/bin/main.ml index 9edd6ac..beb65db 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1,23 +1,11 @@ open Pusk.Utils +open Pusk open Pusk.Net open Pusk.Drivers let main = - let json_payload = - {| - { - "capabilities": { - "alwaysMatch": { - "moz:firefoxOptions": { - "args": ["-headless"] - } - } - } - } - |} - in - let body = send_post_request "http://localhost:4444/session" json_payload in - print_endline (Lwt_main.run body) + let body = execute_request "http://localhost:4444/session" Json.connection_payload in + print_endline body ;; let () = diff --git a/lib/dune b/lib/dune index 01daeb5..06f86ac 100644 --- a/lib/dune +++ b/lib/dune @@ -1,4 +1,4 @@ (library (name pusk) - (modules utils drivers net) + (modules utils drivers net json) (libraries cohttp-lwt-unix)) diff --git a/lib/json.ml b/lib/json.ml new file mode 100644 index 0000000..ee91cd6 --- /dev/null +++ b/lib/json.ml @@ -0,0 +1,13 @@ +let connection_payload = + {| + { + "capabilities": { + "alwaysMatch": { + "moz:firefoxOptions": { + "args": ["-headless"] + } + } + } + } + |} +;;